New-ConsoleLanes
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>]#All Parameter SetsDescription
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 serversLanes 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-ConsoleLanes at different points, printed once
Example 3
Get-ConsoleDemo -Slug 'parallel-patch' | Select-Object -ExpandProperty Source
Get-ConsoleDemo -Slug 'assessment' | Select-Object -ExpandProperty SourceRead 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
- Emphasizes active lane labels.
- -CollapseWhen StatusKind
- Collapses lanes with this status into a summary.
- Possible values:
Pending,Running,Pass,Fail,Warn,Skip,Info,Unknown,Error,Investigate,NotRun - -CollapseWhenFinished SwitchParameter
- Collapses the display to one summary line once every lane has finished.
- -Columns Object[]
- 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
- A script block that emits the lanes: Key/Label records calls, or names.
- -CountColumn ColumnFormat
- Shared CountColumn layout settings as a hashtable, for example @{ MinWidth = 6; Alignment = 'Right' }.
- -CountSkipped SwitchParameter
- Includes skipped work in the completed count.
- -HideCompleted SwitchParameter
- Finished lanes leave the display and are counted in the summary line.
- -InputObject PSObject
- Lanes from the pipeline: Key/Label records objects or names.
- -MaxLabelWidth Int32
- Maximum lane label width in cells; default 28.
- -NoDetail SwitchParameter
- Hides each lane's detail text.
- -NoDimPending SwitchParameter
- Uses normal text instead of dimming pending lanes.
- -PercentColumn ColumnFormat
- Shared PercentColumn layout settings as a hashtable, for example @{ MinWidth = 6; Alignment = 'Right' }.
- -RateWindowSeconds Double
- Rate-estimation window in seconds; default 10.
- -Shape BarShape
- Bar shape: Line (thin stroke) or Block (solid blocks). Default Line.
- Possible values:
Block,Line - -ShowRunningCount SwitchParameter
- Shows a separate count of running lanes.
- -Transient SwitchParameter
- The display disappears once every lane has finished (with Invoke-ConsoleDashboard -PrintFinalState:$false nothing is left).
- -WidgetId String
- 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.