Skip to content
ConsoleMonster
Cmdlet

New-ConsoleLanes

Module
ConsoleMonster
Inputs
System.Management.Automation.PSObject
Outputs
ConsoleMonster.Widgets.Lanes

Creates a lanes widget: one row per worker, server or item of a parallel workload.

Syntax

New-ConsoleLanes
[-BoldActive]
[-CollapseWhen <StatusKind>]
[-CollapseWhenFinished]
[-Columns <Object[]>]
[[-Content] <ScriptBlock>]
[-CountColumn <ColumnFormat>]
[-CountSkipped]
[-HideCompleted]
[-InputObject <PSObject>]
[-MaxLabelWidth <Int32>]
[-NoDetail]
[-NoDimPending]
[-PercentColumn <ColumnFormat>]
[-RateWindowSeconds <Double>]
[-Shape <Block|Line>]
[-ShowRunningCount]
[-Transient]
[[-WidgetId] <String>]
[<CommonParameters>]
#
Parameter set: All Parameter Sets

Description

Each lane shows a status marker (a spinner while running), a progress bar, pass/fail/warning counts and what it is doing now. Declare lanes with names or Key/Label/Total records emitted by Content or the pipeline. Records can include progress, status and counts. A lane can also appear on its first Update-Console call in a live dashboard.

Examples

Example 1

'DC01', 'DC02', 'DC03' | ForEach-Object { @{ Key = $_; Label = $_; Total = 40 } } | New-ConsoleLanes -WidgetId servers

Lanes for three servers with 40 steps each

Example 2

New-ConsoleLanes -Content {
    [pscustomobject]@{ Key = 'DC01'; Total = 40; Status = 'Pass'; Passed = 40; Value = 40 }
    [pscustomobject]@{ Key = 'DC02'; Total = 40; Status = 'Running'; Passed = 21; Warned = 1; Detail = 'replication'; Value = 22 }
    [pscustomobject]@{ Key = 'DC03'; Total = 40 }
} | Show-Console

Lanes at different points, printed once

Example 3

Get-ConsoleDemo -Slug 'parallel-patch' | Select-Object -ExpandProperty Source
Get-ConsoleDemo -Slug 'assessment' | Select-Object -ExpandProperty Source

Read any of these gallery scripts to see New-ConsoleLanes in a complete example. Each lookup returns the script's source. Use the same slug with Show-ConsoleDemo to run it.

Parameters

-BoldActive SwitchParameter optional
Emphasizes active lane labels.
-CollapseWhen StatusKind optional
Collapses lanes with this status into a summary.
Possible values: Pending, Running, Pass, Fail, Warn, Skip, Info, Unknown, Error, Investigate, NotRun
-CollapseWhenFinished SwitchParameter optional
Collapses the display to one summary line once every lane has finished.
-Columns Object[] optional
Builtin names, Type/Alignment/Priority/MaxWidth records or typed columns, in order: Standard (spinner, description, bar, percent, count, elapsed, remaining time, status), or any of Spinner, Description, Bar, Percent, Count, Elapsed, Remaining, Rate, ByteRate, Results and Status. Without it the classic layout shows the label, bar, percentage, pass/fail/warning counts and detail.
-Content ScriptBlock optionalposition: 1
A script block that emits the lanes: Key/Label records calls, or names.
-CountColumn ColumnFormat optional
Shared CountColumn layout settings as a hashtable, for example @{ MinWidth = 6; Alignment = 'Right' }.
-CountSkipped SwitchParameter optional
Includes skipped work in the completed count.
-HideCompleted SwitchParameter optional
Finished lanes leave the display and are counted in the summary line.
-InputObject PSObject optionalpipeline: True (ByValue)
Lanes from the pipeline: Key/Label records objects or names.
-MaxLabelWidth Int32 optional
Maximum lane label width in cells; default 28.
-NoDetail SwitchParameter optional
Hides each lane's detail text.
-NoDimPending SwitchParameter optional
Uses normal text instead of dimming pending lanes.
-PercentColumn ColumnFormat optional
Shared PercentColumn layout settings as a hashtable, for example @{ MinWidth = 6; Alignment = 'Right' }.
-RateWindowSeconds Double optional
Rate-estimation window in seconds; default 10.
-Shape BarShape optional
Bar shape: Line (thin stroke) or Block (solid blocks). Default Line.
Possible values: Block, Line
-ShowRunningCount SwitchParameter optional
Shows a separate count of running lanes.
-Transient SwitchParameter optional
The display disappears once every lane has finished (with Invoke-ConsoleDashboard -PrintFinalState:$false nothing is left).
-WidgetId String optionalposition: 0
The live name (default lanes). A script block here is taken as -Content.

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.