Skip to content
ConsoleMonster
Cmdlet

New-ConsolePanel

Module
ConsoleMonster
Inputs
System.Object
Outputs
ConsoleMonster.Layout.IWidget

Creates a bordered panel with a title around other console widgets.

Syntax

New-ConsolePanel
[-Border <Rounded|Single|Double|Heavy|Ascii>]
[-BorderRole <ThemeToken>]
[-Caption <Object>]
[[-Content] <Object>]
[-Fill]
[-Gap <Int32>]
[-HeaderRight <Object>]
[-Height <Int32>]
[-NoExpand]
[-PaddingBottom <Int32>]
[-PaddingLeft <Int32>]
[-PaddingRight <Int32>]
[-PaddingTop <Int32>]
[-Status <StatusKind>]
[-Title <Object>]
[-Verdict]
[-Weight <Double>]
[<CommonParameters>]
#
Parameter set: All Parameter Sets

Description

-Content is a scriptblock, a widget, text or any objects (objects are shown as a record or a table; several pieces are stacked vertically). Borders follow the detected glyph tier: rounded on modern fonts, single lines on Consolas, +-| in ASCII mode. Inside New-ConsoleColumns, panels share the row height.

Examples

Example 1

$panelOptions = @{
    Title = 'Targets'
    Weight = 2
    Content = { New-ConsoleLanes -WidgetId targets }
}
New-ConsolePanel @panelOptions

A panel holding a lanes widget, taking two shares of a row

Example 2

$panelOptions = @{
    Title = 'Inventory result'
    Content = {
        $showConsoleOptions = @{
            AsWidget = $true
            View = 'List'
        }
        [pscustomobject]@{ Name = 'web01'; State = 'Online' } | Show-Console @showConsoleOptions
    }
}
New-ConsolePanel @panelOptions | Show-Console

Frame an inventory record with a heading

Example 3

Get-ConsoleDemo -Slug 'help-sections' | Select-Object -ExpandProperty Source
Get-ConsoleDemo -Slug 'task-menu' | Select-Object -ExpandProperty Source

Read any of these gallery scripts to see New-ConsolePanel in a complete example. Each lookup returns the script's source. Use the same slug with Show-ConsoleDemo to run it.

Parameters

-Border BoxStyle optional
Border style: Rounded, Single, Double, Heavy, Ascii or None.
Possible values: Rounded, Single, Double, Heavy, Ascii
-BorderRole ThemeToken optional
The semantic border colour.
Possible values: Text, Muted, Subtle, Accent, Accent2, Pass, Fail, Warn, Info, Skip, Running, Pending, Border, Title, Header, Highlight, Surface, SurfaceAccent, Series1, Series2, Series3, Series4, Series5, Series6, Focus, Strong, Low, Critical, Gap
-Caption Object optional
Text on the right of the bottom border.
-Content Object optionalposition: 0pipeline: True (ByValue)
The panel content: a scriptblock that emits widgets, text or objects, a widget, a string, or objects (one object is shown as labelled fields, several as a table, through the same rules as Show-Console -View List and Show-ConsoleTable).
-Fill SwitchParameter optional
Take the remaining height of a live dashboard (for example a log).
-Gap Int32 optional
Blank rows between content children when -Content emits several widgets (default 0); 1 spaces a report's sections.
-HeaderRight Object optional
Text on the right of the top border, for example a count.
-Height Int32 optional
Fixed height in rows, including the border.
-NoExpand SwitchParameter optional
Fits the panel to content instead of filling its available width.
-PaddingBottom Int32 optional
Rows between content and the bottom border.
-PaddingLeft Int32 optional
Cells between the left border and content.
-PaddingRight Int32 optional
Cells between content and the right border.
-PaddingTop Int32 optional
Rows between the top border and content.
-Status StatusKind optional
Status colour and title glyph for a verdict.
Possible values: Pending, Running, Pass, Fail, Warn, Skip, Info, Unknown, Error, Investigate, NotRun
-Title Object optional
The title shown in the top border (Spectre-style markup allowed).
-Verdict SwitchParameter optional
Double-bordered verdict with a centred title.
-Weight Double optional
Share of the width (in columns) or height (in a live dashboard) this panel takes.

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.