Cmdlet
New-ConsoleStack
Layers console widgets on top of each other in the same space.
Syntax
New-ConsoleStack
[[-Content] <Object>]
[-Fill]
[-Height <Int32>]
[-Weight <Double>]
[<CommonParameters>]#Parameter set:
All Parameter SetsDescription
Each widget the scriptblock emits is a layer, bottom first; later layers paint over earlier ones and replace only the cells they write. Combine with New-ConsoleRegion to place an overlay, such as a badge in a corner of a chart. To place widgets one below another, use New-ConsoleRows.
Examples
Example 1
New-ConsoleStack -Content {
$chartOptions = @{
WidgetId = 'latency'
Type = 'Line'
}
New-ConsoleChart @chartOptions
$regionOptions = @{
Horizontal = 'Right'
Content = { New-ConsoleText -Markup '[pass]LIVE[/]' }
}
New-ConsoleRegion @regionOptions
}A chart with a status badge in its top-right corner
Example 2
$stackOptions = @{
Height = 6
Content = {
$panelOptions = @{
Title = 'Inventory'
Content = {
$textOptions = @{
Text = @('web01: Online')
}
New-ConsoleText @textOptions
}
}
New-ConsolePanel @panelOptions
}
}
New-ConsoleStack @stackOptions | Show-ConsoleCompose an inventory stack
Parameters
- -Content Object
- Scriptblock that emits the layers, bottom first.
- -Fill SwitchParameter
- Take the remaining height of a live dashboard.
- -Height Int32
- Fixed height in rows.
- -Weight Double
- Share of the width (in columns) or height (in a live dashboard) this widget 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.