New-ConsoleDashboardFrame
Creates a dashboard frame: a summary with a title line, meters, a needs-attention list, sections, a legend and a footer.
Syntax
New-ConsoleDashboardFrame
[-Attention <Object[]>]
[-Fact <String[]>]
[-FooterCount <String[]>]
[-FooterHint <EveryRow| EveryProperty>]
[-Legend <Object>]
[-Length <Summary| Standard| Full>]
[-Meter <Object[]>]
[-Noun <String>]
[-ObservedAt <DateTimeOffset>]
[-OutOf <Int64>]
[-Section <Object[]>]
[-State <Object[]>]
[-Title] <String>
[<CommonParameters>]#All Parameter SetsDescription
For a script that builds its own summary. The frame prints once and lays itself out for the terminal's width: the facts follow the title and the states sit at its right, meters fill a row in the order given, Needs attention lists problems worst first, summary sections pack beside it, detail sections print below at full width, then the legend and the footer. Below 80 columns meters stack and sections take the whole width. Meters, states, attention items and sections are records or hashtables, the way New-ConsoleTabs takes pages. A module that owns summary objects declares its frame in C# and registers it as their default display instead.
Examples
Example 1
New-ConsoleDashboardFrame -Title 'Server estate' -Fact 'contoso.example', '48 servers' -State @{ State = 'Failing'; Count = 1; Word = 'failing' } -Meter @(
@{ Label = 'Servers healthy'; Healthy = 44; Warning = 3; Failing = 1 }
@{ Label = 'Backups current'; Healthy = 46; Whole = 48 }
) -Attention @{ State = 'Failing'; Identity = 'SQL-03'; Reason = 'Disk D: 97% full'; Values = '97%' } -Noun server -OutOf 48 -Section @{
Title = 'Sites'; Content = { New-ConsoleKeyValue -InputObject ([ordered] @{ London = 22; Amsterdam = 16 }) }
} | Show-ConsoleA small estate summary.
Example 2
New-ConsoleDashboardFrame -Title 'Fleet checks' -Fact '12 servers inspected' -Meter @{
Kind = 'Count'; Label = 'Passed'; Value = 12; State = 'Healthy'
} | Show-ConsoleCompose an inventory dashboard frame
Parameters
- -Attention Object[]
- Needs-attention items: records with State, Identity, Reason, and optionally Order (worst first when given) and Values (short values beside the item).
- -Fact String[]
- Facts after the title, such as the scope and counts.
- Counts in the footer, such as '48 servers'.
- The footer hint: None (default, for a frame the script builds), EveryRow or EveryProperty (for frames shown for pipeline objects).
- Possible values:
EveryRow,EveryProperty - -Legend Object
- Legend entries: an ordered dictionary of state to word, or records with State and Word.
- -Length ConsoleViewLength
- An explicit length (Summary, Standard or Full); without it the session preference or Standard.
- Possible values:
Summary,Standard,Full - -Meter Object[]
- Headline meters in priority order: records with Label and Kind (Composition, Ratio, Count, Fact or Missing). Composition takes Healthy, Warning, Failing, Unknown and NotEvaluated; Ratio takes Healthy, Whole and Rest; Count takes a number Value; Fact takes a text Value; Count and Fact also take Fact and State; Missing takes Reason. Without Kind, Whole means Ratio, Healthy means Composition, a number Value means Count, other Value means Fact, and no value means Missing.
- -Noun String
- What the attention list counts, in the singular, as in '3 of 48 servers' (default item).
- -ObservedAt DateTimeOffset
- When the data was observed; the title line shows how long ago.
- -OutOf Int64
- The total the attention list counts against.
- -Section Object[]
- Sections: records with Title and Content (widgets, text or a script block), and optionally Placement (Summary or Detail), Facts, Meta, States, MinWidth, MaxWidth, Grow and FullWidth.
- -State Object[]
- States at the right of the title line: records or hashtables with State (Healthy, Warning, Failing, Unknown or NotEvaluated), Count and Word.
- -Title String
- The literal title, usually the view name.
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.