New-ConsoleSummaryBar
Creates a summary bar: one line with progress, done of total, the time left and result counters.
Syntax
New-ConsoleSummaryBar [-BarWidth <Int32>] [-Counter <IDictionary>] [[-Done] <Double>] [-Elapsed <TimeSpan>] [-Name <String>] [[-Total] <Double>] [<CommonParameters>]#All Parameter SetsDescription
Creates a summary bar: one line with progress, done of total, the time left and result counters.
The line Invoke-ConsoleRun ends its view with, as a widget of its own: a thin bar, done of total, the percentage, the time left (estimated from -Elapsed and the share done) and counters in a fixed order with zeros dimmed rather than hidden. -Counter maps labels to counts; a label that is a status word (passed, failed, warnings, skipped, running) takes that status's symbol and colour. Without -Total only the count done shows.
Examples
EXAMPLE 1
New-ConsoleSummaryBar -Done 30 -Total 40 -Elapsed (New-TimeSpan -Seconds 42) -Counter ([ordered] @{ passed = 27; failed = 2; skipped = 1 }) | Write-ConsoleWidgetA run three quarters through
Parameters
- -BarWidth Int32
- The bar width in cells (default 20; narrow space shrinks it).
- -Counter IDictionary
- Labels mapped to counts, in the order to show them; status words (passed, failed, skipped...) take their status symbol and colour.
- -Done Double
- Items done.
- -Elapsed TimeSpan
- The time the run has taken so far, for the time left: a TimeSpan, seconds, or a number with a unit (42s, 1.5m).
- -Name String
- The live name (default summary).
- -Total Double
- Items in total (0 = unknown: no bar, percentage or time left).
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.