Skip to content
ConsoleMonster
Cmdlet

New-ConsoleStack

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

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 Sets

Description

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

Compose an inventory stack

Parameters

-Content Object optionalposition: 0pipeline: True (ByValue)
Scriptblock that emits the layers, bottom first.
-Fill SwitchParameter optional
Take the remaining height of a live dashboard.
-Height Int32 optional
Fixed height in rows.
-Weight Double optional
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.