New-ConsoleDocumentViewer
Creates a document viewer for a region of Show-ConsoleApp.
Syntax
New-ConsoleDocumentViewer
[-Disabled]
[-Height <Int32>]
[-Key] <String>
[[-Label] <String>]
-Markdown <String>
[-OnChange <ScriptBlock>]
[-TabIndex <Int32>]
[-ValidationMessage <String>]
[<CommonParameters>]#MarkdownNew-ConsoleDocumentViewer
[-Disabled]
[-Height <Int32>]
[-Key] <String>
[[-Label] <String>]
[-OnChange <ScriptBlock>]
[-TabIndex <Int32>]
[-ValidationMessage <String>]
-Widget <IWidget>
[<CommonParameters>]#WidgetNew-ConsoleDocumentViewer
[-Disabled]
[-Height <Int32>]
[-Key] <String>
[[-Label] <String>]
[-OnChange <ScriptBlock>]
-Parts <IDictionary>
[-TabIndex <Int32>]
[-ValidationMessage <String>]
[<CommonParameters>]#PartsDescription
Browse a widget or Markdown with a pinned heading path, an outline when there is room, folding headings, and find. Named parts appear as tabs. Alt+Down/Up changes panes inside the viewer, and Tab moves to the next app control. Use [ and ] to select a link, Enter to follow it, and Alt+Left/Right to go back and forward. The state value is the current heading title, or null before a heading.
Examples
Example 1
$runbook = "# Health" + [Environment]::NewLine + "Check the dashboard first."
Show-ConsoleApp -Content {
New-ConsoleDocumentViewer -Key runbook -Markdown $runbook
New-ConsoleButton -Key refresh -Label 'Refresh'
}Put a runbook alongside other app controls.
Parameters
- -Disabled SwitchParameter
- Disables editing and removes the input from keyboard focus traversal.
- -Height Int32
- Natural visible content rows.
- -Key String
- Unique key in the application's state and final hashtable.
- -Label String
- Visible label; defaults to the name using the core control's labels.
- -Markdown String
- Markdown source. Headings become outline entries and foldable sections.
- -OnChange ScriptBlock
- Runs once per committed edit on the owning input thread. Receives param($Value, $State) and injected $Value, $State and $Control. State is a hashtable; add or assign keys to write back. Output is discarded. Retains closure variables.
- -TabIndex Int32
- Keyboard focus order. Equal values preserve layout declaration order.
- -ValidationMessage String
- Initial validation text displayed below the input.
- -Widget IWidget
- A widget to browse, such as a view returned by Show-Console -AsWidget.
- -Parts IDictionary
- A dictionary from tab title to Markdown text or a widget. Use an ordered dictionary to set tab order.
Common Parameters
This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
For more information, see about_CommonParameters.