Skip to content
ConsoleMonster
Cmdlet

New-ConsoleRegion

Module ConsoleMonster
Inputs
ConsoleMonster.Layout.IWidget
Outputs
ConsoleMonster.Layout.IWidget

Creates a named region whose content can be replaced while a dashboard runs.

Syntax

New-ConsoleRegion [[-Content] <ScriptBlock>] [-Fill] [-Height <Int32>] [-Name] <String> [-Weight <Double>] [-Widget <IWidget>] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Description

Creates a named region whose content can be replaced while a dashboard runs.

Put the region anywhere in a layout (inside New-ConsolePanel keeps the frame), then call Set-ConsoleRegion -Name with a new widget from the dashboard script. The swap is queued like every update, lands between frames and redraws only what changed.

Examples

Authored help example

EXAMPLE 1

New-ConsoleRegion -Name 'Name'

Parameters

-Content ScriptBlock optionalposition: 1
A script block whose widgets are the first content.
-Fill SwitchParameter optional
Takes the remaining height.
-Height Int32 optional
A fixed height in rows.
-Name String requiredposition: 0
The region name used by Set-ConsoleRegion.
-Weight Double optional
The share of the remaining space in a row or column layout.
-Widget IWidget optionalpipeline: True (ByValue)
A widget as the first content.

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.