New-ConsoleDashboard
Defines a live console dashboard: a header with title and clock, the body and a footer.
Syntax
New-ConsoleDashboard
[[-Content] <Object>]
[-Detail <Object>]
[-Footer <Object>]
[-FooterHints <Object[]>]
[-Gap <Int32>]
[-NoElapsed]
[-Status <StatusKind>]
[-Subtitle <Object>]
-Title <Object>
[[-WidgetId] <String>]
[<CommonParameters>]#All Parameter SetsDescription
The scriptblock emits the body widgets top to bottom. Pass the result to Invoke-ConsoleDashboard to run it live, or to Show-Console to print it once.
Examples
Example 1
$dashboardOptions = @{
Title = 'Deploy'
Content = {
$panelOptions2 = @{
Title = 'Servers'
Content = { New-ConsoleLanes -WidgetId servers }
}
New-ConsolePanel @panelOptions2;
$panelOptions = @{
Fill = $true
Title = 'Log'
Content = { New-ConsoleLogRegion }
}
New-ConsolePanel @panelOptions
}
}
$d = New-ConsoleDashboard @dashboardOptionsA dashboard with lanes and a log that fills the rest of the screen
Example 2
$dashboardOptions = @{
Title = 'Inventory'
Content = {
$panelOptions = @{
Title = 'Result'
Content = {
$textOptions = @{
Text = @('2 servers online')
Role = 'Pass'
}
New-ConsoleText @textOptions
}
}
New-ConsolePanel @panelOptions
}
}
New-ConsoleDashboard @dashboardOptions | Show-ConsoleCompose an inventory dashboard
Example 3
Get-ConsoleDemo -Slug 'assessment' | Select-Object -ExpandProperty Source
Get-ConsoleDemo -Slug 'stress' | Select-Object -ExpandProperty Source
Get-ConsoleDemo -Slug 'pipeline' | Select-Object -ExpandProperty SourceRead any of these gallery scripts to see New-ConsoleDashboard in a complete example. Each lookup returns the script's source. Use the same slug with Show-ConsoleDemo to run it.
Parameters
- -Content Object
- Scriptblock that emits the body widgets.
- -Detail Object
- Additional header detail, including markup.
- Footer text; defaults to a Ctrl+C hint.
- Key/label dictionaries or typed KeyHint values; replaces the default Ctrl+C hint. Used when Footer is unset.
- -Gap Int32
- Blank rows between the body widgets.
- -NoElapsed SwitchParameter
- Hides the default elapsed clock in the dashboard header.
- -Status StatusKind
- Initial header status.
- Possible values:
Pending,Running,Pass,Fail,Warn,Skip,Info,Unknown,Error,Investigate,NotRun - -Subtitle Object
- A subtitle shown after the title.
- -Title Object
- The title shown in the header bar (markup allowed).
- -WidgetId String
- Live name of the dashboard (for Update-Console title, detail and status updates).
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.