New-ConsolePanel
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>]#All Parameter SetsDescription
-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 @panelOptionsA 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-ConsoleFrame 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 SourceRead 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
- Border style: Rounded, Single, Double, Heavy, Ascii or None.
- Possible values:
Rounded,Single,Double,Heavy,Ascii - -BorderRole ThemeToken
- 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
- Text on the right of the bottom border.
- -Content Object
- 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
- Take the remaining height of a live dashboard (for example a log).
- -Gap Int32
- Blank rows between content children when -Content emits several widgets (default 0); 1 spaces a report's sections.
- -HeaderRight Object
- Text on the right of the top border, for example a count.
- -Height Int32
- Fixed height in rows, including the border.
- -NoExpand SwitchParameter
- Fits the panel to content instead of filling its available width.
- -PaddingBottom Int32
- Rows between content and the bottom border.
- -PaddingLeft Int32
- Cells between the left border and content.
- -PaddingRight Int32
- Cells between content and the right border.
- -PaddingTop Int32
- Rows between the top border and content.
- -Status StatusKind
- Status colour and title glyph for a verdict.
- Possible values:
Pending,Running,Pass,Fail,Warn,Skip,Info,Unknown,Error,Investigate,NotRun - -Title Object
- The title shown in the top border (Spectre-style markup allowed).
- -Verdict SwitchParameter
- Double-bordered verdict with a centred title.
- -Weight Double
- 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.