Skip to content
ConsoleMonster
Cmdlet

Start-ConsoleDashboard

Module ConsoleMonster
Inputs
System.Object

Runs a console dashboard live while a script does the work.

Syntax

Start-ConsoleDashboard [-ArgumentList <Object[]>] [-AutoRecord <Int32>] [-Dashboard] <IWidget> [-FramesPerSecond <Int32>] [-ImportModule <String[]>] [-Inline] [-InputObject <Object>] [-Parallel] [-RecordPath <String>] [-ScriptBlock] <ScriptBlock> [-Summary <IWidget>] [-ThrottleLimit <Int32>] [-Transient] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Description

Runs a console dashboard live while a script does the work.

The script runs in a runspace the module owns (or, with -Parallel, once per input item on a runspace pool, started as items arrive and limited by -ThrottleLimit). Inside it, $ConsoleSession and the Update-ConsoleLane, Update-ConsolePhase, Write-ConsoleLog and related cmdlets update the screen; Write-Host, Write-Warning, Write-Verbose, errors and Console.WriteLine go to the dashboard's log region instead of scribbling over the screen. The screen is redrawn at about 15 frames per second however many updates arrive. Ctrl+C stops the script and always restores the terminal; the dashboard then leaves the alternate screen and prints its final state (or -Summary). Script output is returned when the dashboard ends. In redirected or CI output the dashboard becomes append-only lines. Variables from the caller are not visible inside the script: pass them with -ArgumentList and a param() block.

Examples

Authored help example

EXAMPLE 1

Start-ConsoleDashboard -Dashboard 'Value' -ScriptBlock { }

Parameters

-ArgumentList Object[] optional
Arguments passed to the script (after the input item with -Parallel).
-AutoRecord Int32 optional
Records the run automatically to the local ConsoleMonster\Recordings folder and keeps only this many recent runs (within 50 MB together), for Show-ConsoleReplay. Ignored with -RecordPath.
-Dashboard IWidget requiredposition: 0
The dashboard from New-ConsoleDashboard (or any widget tree).
-FramesPerSecond Int32 optional
Redraw rate (default 15).
-ImportModule String[] optional
Modules to import into the dashboard runspaces.
-Inline SwitchParameter optional
Draws the dashboard inline, below the cursor, instead of on the alternate screen: output and log lines scroll above it and the final state stays in the scrollback.
-InputObject Object optionalpipeline: True (ByValue)
Items processed with -Parallel; each item is the script's first argument.
-Parallel SwitchParameter optional
Run the script once per input item on a runspace pool.
-RecordPath String optional
Record every update as JSON lines for Start-ConsoleReplay.
-ScriptBlock ScriptBlock requiredposition: 1
The work to run while the dashboard is live.
-Summary IWidget optional
A widget printed to scrollback after the dashboard ends (default: the dashboard's final state).
-ThrottleLimit Int32 optional
Maximum concurrent runspaces with -Parallel (default 4).
-Transient SwitchParameter optional
Leaves nothing behind when the dashboard ends (no final state in the scrollback).

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.