Skip to content
ConsoleMonster
Cmdlet

Show-ConsoleDiagram

Module
ConsoleMonster
Inputs
System.Management.Automation.PSObject
Outputs
ConsoleMonster.Widgets.Diagram System.String

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>]
#
Parameter set: Rows
Show-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>]
#
Parameter set: Path

Description

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.md

Explore a diagram and its use cases with the keyboard.

Example 2

Show-ConsoleDiagram -Path ./ad-replication.md -Scenario replicate -Step 6 -StaticSnapshot

Print one step of a use case without reading keys.

Example 3

Show-ConsoleDiagram -Path ./tierbridge.md -Scenario blocked -Step 7 -Width 120 -AsString

Capture the diagram as plain text for a log or a ticket.

Example 4

$rows | Show-ConsoleDiagram -Title 'Replication' -StaticSnapshot

Show connection rows using their standard columns.

Example 5

$rows | Show-ConsoleDiagram -From Source -To Destination -Label { $_.Lag.ToString() + ' min' } -Status Health -Group Site -AsString

Select columns and calculate connection labels.

Parameters

-AsString SwitchParameter optional
Returns the static view as one plain-text string.
-AsWidget SwitchParameter optional
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 optionalposition: 0sets: Rows
Emits typed diagram nodes, links, groups and use cases.
-Diagram String optional
The diagram id to show when the file has more than one architecture, topology or flow diagram.
-Direction DiagramDirection optional
The layout direction.
Possible values: Right, Down, Left, Up
-From Object optionalsets: Rows
Source property name or script block; defaults to From.
-Group Object optionalsets: Rows
Source group property name or script block; defaults to Group.
-InputObject PSObject optionalpipeline: True (ByValue)sets: Rows
Connection rows or an existing diagram.
-Label Object optionalsets: Rows
Connection label property name or script block; defaults to Label.
-MaxPayloadLines Int32 optional
The maximum visible payload lines.
-MaxStepLines Int32 optional
The maximum visible step lines.
-Mode InteractionMode optional
Rich runs the keyboard view. Line, Accessible, None and Snapshot print the static view.
Possible values: Rich, Line, Accessible, Snapshot
-NoSummary SwitchParameter optional
Hides the full-text attention list.
-Scenario String optional
The use case id to select. Defaults to the diagram's first use case.
-ShowDetails Boolean optional
Shows focused-node details.
-ShowKeys SwitchParameter optional
Shows keyboard hints.
-ShowLegend Boolean optional
Shows status meanings below the topology.
-ShowStepPanel Boolean optional
Shows use-case steps.
-StaticSnapshot SwitchParameter optional
Prints a static view without reading keys.
-Status Object optionalsets: Rows
Health property name or script block; defaults to Status.
-Step Int32 optional
The one-based step to highlight in the selected use case. Interactive views start there; static views show that step.
-Title String optional
The diagram title.
-To Object optionalsets: Rows
Destination property name or script block; defaults to To.
-WidgetId String optional
The identifier addressed by Update-Console.
-Width Int32 optional
Width used by the static view; zero detects the host width.
-Path String requiredposition: 0sets: Path
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.