New-ConsoleCellMap
Creates a cell map: one status symbol per item of a run, with a legend of counts.
Syntax
New-ConsoleCellMap [-Columns <Int32>] [-Count <Int32>] [-LegendLines <Int32>] [-MaxRows <Int32>] [-Name <String>] [-NoLegend] [-RowLabels <String[]>] [[-Status] <Object[]>] [<CommonParameters>]#All Parameter SetsDescription
Creates a cell map: one status symbol per item of a run, with a legend of counts.
The map Invoke-ConsoleRun shows for many items, as a widget of its own: each item is one cell in its status colour (pass, fail, warn, skip, running, pending), wrapping to the width, followed by a legend with each state's count. States come from -Status or the pipeline, in the shared status vocabulary (PowerShell's words such as Success and Error work too). -Count adds pending cells for items not started yet. -Columns and -RowLabels turn it into a labelled grid (one row per server, one column per check) with one legend below, which -LegendLines lets wrap. To add cells later, pipe the map to Add-ConsoleItem; in a live dashboard, update cells with Update-ConsoleCell.
Examples
EXAMPLE 1
$states = @('Pass') * 28 + @('Fail') * 2 + @('Warn') + @('Running') * 4
New-ConsoleCellMap -Status $states -Count 40 | Write-ConsoleWidgetForty items part-way through a run
EXAMPLE 2
$results | ForEach-Object Result | New-ConsoleCellMap | Write-ConsoleWidgetStates from objects
EXAMPLE 3
New-ConsoleCellMap -Name checks -Count 12 -Columns 4 -RowLabels 'SRV01', 'SRV02', 'SRV03' -LegendLines 2 -Status Pass, Pass, Fail, Warn, Pass | Write-ConsoleWidgetA grid of three servers by four checks, with the server names beside the rows
Parameters
- -Columns Int32
- The cells per row (0 = as many as fit). Set it to draw a grid, such as one row per server and one column per check; cells past the width are cut off rather than moved to the next row.
- -Count Int32
- The total number of items; cells beyond the given states are pending.
- -LegendLines Int32
- The most lines the legend wraps onto when it is wider than the map (default 1: it is cut off instead).
- -MaxRows Int32
- The most rows of cells (0 = all); a last line counts the items not shown.
- -Name String
- The live name (default cells).
- -NoLegend SwitchParameter
- Hide the legend line with each state's count.
- -RowLabels String[]
- Labels drawn muted before the rows, one per row in order; the cells start after the widest label. With -Columns they make a labelled grid with one legend below it.
- -Status Object[]
- The item states, in order: Pass, Fail, Warn, Skip, Info, Running or Pending (pipeline input works too).
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.