Skip to content
ConsoleMonster
Cmdlet

New-ConsoleSummaryBar

Module ConsoleMonster
Inputs
None
Outputs
ConsoleMonster.Widgets.SummaryBar

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>]
#
Parameter set: All Parameter Sets

Description

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

Authored help example

EXAMPLE 1

New-ConsoleSummaryBar -Done 30 -Total 40 -Elapsed (New-TimeSpan -Seconds 42) -Counter ([ordered] @{ passed = 27; failed = 2; skipped = 1 }) | Write-ConsoleWidget

A run three quarters through

Parameters

-BarWidth Int32 optional
The bar width in cells (default 20; narrow space shrinks it).
-Counter IDictionary optional
Labels mapped to counts, in the order to show them; status words (passed, failed, skipped...) take their status symbol and colour.
-Done Double optionalposition: 0
Items done.
-Elapsed TimeSpan optional
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 optional
The live name (default summary).
-Total Double optionalposition: 1
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.