Skip to content
ConsoleMonster
Cmdlet

New-ConsoleFacts

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

Creates a facts line with bold counts, semantic colours and shared separators.

Syntax

New-ConsoleFacts
[[-Content] <ScriptBlock>]
[[-InputObject] <PSObject>]
[<CommonParameters>]
#
Parameter set: All Parameter Sets

Description

Each fact is a value or a record with Value, Label, Caption, Presenter, Role and NewLine. Counts are bold, status words use the same colour, and neutral facts are muted. Facts wrap between items. ASCII uses | instead of the middle dot.

Examples

Example 1

New-ConsoleFacts -Content { @{ Value = 3; Label = 'passed'; Role = 'Pass' }; @{ Value = 1; Label = 'warning'; Role = 'Warn' }; @{ Value = 5; Label = 'checks' } } | Show-Console

A report summary

Example 2

$summary = [pscustomobject]@{ Value = 4; Label = 'servers online'; Role = 'Pass' }
$summary | New-ConsoleFacts | Show-Console

Show the number of online servers

Parameters

-Content ScriptBlock optionalposition: 1
A script block emitting values or records with Value, Label and an optional Role, Caption, Presenter and NewLine.
-InputObject PSObject optionalposition: 0pipeline: True (ByValue)
Values or fact records, in display order.

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.