Show-ConsoleDiagram
Shows a diagram from connection rows, a Diagram widget or a ChartForgeX file, with use case playback.
Syntax
Show-ConsoleDiagram
[-AsString]
[-AsWidget]
[[-Content] <ScriptBlock>]
[-Diagram <String>]
[-Direction <Right| Down| Left| Up>]
[-From <Object>]
[-Group <Object>]
[-InputObject <PSObject>]
[-Label <Object>]
[-MaxPayloadLines <Int32>]
[-MaxStepLines <Int32>]
[-Mode <Rich| Line| Accessible| Snapshot>]
[-NoSummary]
[-Scenario <String>]
[-ShowDetails <Boolean>]
[-ShowKeys]
[-ShowLegend <Boolean>]
[-ShowStepPanel <Boolean>]
[-StaticSnapshot]
[-Status <Object>]
[-Step <Int32>]
[-Title <String>]
[-To <Object>]
[-WidgetId <String>]
[-Width <Int32>]
[<CommonParameters>]#RowsShow-ConsoleDiagram
[-AsString]
[-AsWidget]
[-Diagram <String>]
[-Direction <Right| Down| Left| Up>]
[-MaxPayloadLines <Int32>]
[-MaxStepLines <Int32>]
[-Mode <Rich| Line| Accessible| Snapshot>]
[-NoSummary]
[-Path] <String>
[-Scenario <String>]
[-ShowDetails <Boolean>]
[-ShowKeys]
[-ShowLegend <Boolean>]
[-ShowStepPanel <Boolean>]
[-StaticSnapshot]
[-Step <Int32>]
[-Title <String>]
[-WidgetId <String>]
[-Width <Int32>]
[<CommonParameters>]#PathDescription
Pipe connection rows with From, To, Label, Status and Group, or select other columns with property names or script blocks using $_. New-ConsoleDiagram builds the same widget from nodes, links, groups and use cases. Nodes keep their subtitle and live value on separate lines. A narrow view becomes a grouped wrapping tree, retaining every connection label. The Needs attention list includes each non-Pass node and link; -NoSummary hides it.
Reads a Markdown file with ChartForgeX visual fences, or a plain architecture file without fences, and draws the diagram in terminal cells: boxes, routed connections, dashed groups and a legend. When the diagram has use cases, the first one is selected and its steps, payloads and keys are shown. In an interactive console, Left and Right step through the use case, Space plays it, Tab switches use cases, Up and Down move the focus between nodes or scroll a diagram taller than the viewport, and D shows the focused node's details. The app footer shows the exit key. In redirected, CI, line and non-interactive sessions, or with -StaticSnapshot, one static view is printed at the chosen step. Errors in the selected diagram stop the command with the file line and diagnostic code. Errors in other visual fences and markup warnings are written as PowerShell warnings. -Path reads one file and cannot be combined with pipeline input; pipe connection rows without -Path.
Examples
Example 1
Show-ConsoleDiagram -Path ./ad-replication.mdExplore a diagram and its use cases with the keyboard.
Example 2
Show-ConsoleDiagram -Path ./ad-replication.md -Scenario replicate -Step 6 -StaticSnapshotPrint one step of a use case without reading keys.
Example 3
Show-ConsoleDiagram -Path ./tierbridge.md -Scenario blocked -Step 7 -Width 120 -AsStringCapture the diagram as plain text for a log or a ticket.
Example 4
$rows | Show-ConsoleDiagram -Title 'Replication' -StaticSnapshotShow connection rows using their standard columns.
Example 5
$rows | Show-ConsoleDiagram -From Source -To Destination -Label { $_.Lag.ToString() + ' min' } -Status Health -Group Site -AsStringSelect columns and calculate connection labels.
Parameters
- -AsString SwitchParameter
- Returns the static view as one plain-text string.
- -AsWidget SwitchParameter
- Returns the diagram widget without drawing it, for static display or live updates in Show-ConsoleApp layouts. The consumer must handle keys to enable diagram navigation and playback. Cannot be combined with -AsString or -StaticSnapshot.
- -Content ScriptBlock
- Emits typed diagram nodes, links, groups and use cases.
- -Diagram String
- The diagram id to show when the file has more than one architecture, topology or flow diagram.
- -Direction DiagramDirection
- The layout direction.
- Possible values:
Right,Down,Left,Up - -From Object
- Source property name or script block; defaults to From.
- -Group Object
- Source group property name or script block; defaults to Group.
- -InputObject PSObject
- Connection rows or an existing diagram.
- -Label Object
- Connection label property name or script block; defaults to Label.
- -MaxPayloadLines Int32
- The maximum visible payload lines.
- -MaxStepLines Int32
- The maximum visible step lines.
- -Mode InteractionMode
- Rich runs the keyboard view. Line, Accessible, None and Snapshot print the static view.
- Possible values:
Rich,Line,Accessible,Snapshot - -NoSummary SwitchParameter
- Hides the full-text attention list.
- -Scenario String
- The use case id to select. Defaults to the diagram's first use case.
- -ShowDetails Boolean
- Shows focused-node details.
- -ShowKeys SwitchParameter
- Shows keyboard hints.
- -ShowLegend Boolean
- Shows status meanings below the topology.
- -ShowStepPanel Boolean
- Shows use-case steps.
- -StaticSnapshot SwitchParameter
- Prints a static view without reading keys.
- -Status Object
- Health property name or script block; defaults to Status.
- -Step Int32
- The one-based step to highlight in the selected use case. Interactive views start there; static views show that step.
- -Title String
- The diagram title.
- -To Object
- Destination property name or script block; defaults to To.
- -WidgetId String
- The identifier addressed by Update-Console.
- -Width Int32
- Width used by the static view; zero detects the host width.
- -Path String
- The Markdown or architecture file to read. A file without visual fences is read as one ChartForgeX architecture diagram.
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.