Skip to content
ConsoleMonster
Cmdlet

New-ConsoleDashboard

Module
ConsoleMonster
Inputs
System.Object
Outputs
ConsoleMonster.Widgets.Dashboard

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

Description

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 @dashboardOptions

A 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-Console

Compose 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 Source

Read 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 optionalposition: 1pipeline: True (ByValue)
Scriptblock that emits the body widgets.
-Detail Object optional
Additional header detail, including markup.
Footer text; defaults to a Ctrl+C hint.
-FooterHints Object[] optional
Key/label dictionaries or typed KeyHint values; replaces the default Ctrl+C hint. Used when Footer is unset.
-Gap Int32 optional
Blank rows between the body widgets.
-NoElapsed SwitchParameter optional
Hides the default elapsed clock in the dashboard header.
-Status StatusKind optional
Initial header status.
Possible values: Pending, Running, Pass, Fail, Warn, Skip, Info, Unknown, Error, Investigate, NotRun
-Subtitle Object optional
A subtitle shown after the title.
-Title Object required
The title shown in the header bar (markup allowed).
-WidgetId String optionalposition: 0
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.