Skip to content
ConsoleMonster
Cmdlet

New-ConsoleAlign

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

Aligns console widgets left, centre or right, and top, middle or bottom, inside their space.

Syntax

New-ConsoleAlign [[-Content] <ScriptBlock>] [-Fill] [-Height <Int32>] [-Horizontal <Left|Center|Right>] [-Vertical <Top|Middle|Bottom>] [-Weight <Double>] [-Widget <IWidget>] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Description

Aligns console widgets left, centre or right, and top, middle or bottom, inside their space.

The content keeps its measured size and is placed within the space the parent gives it. Horizontal alignment uses the full width; vertical alignment applies when the parent gives more rows than the content needs (-Height or -Fill). Widgets that already use the full width, such as progress bars, only move vertically.

Examples

Authored help example

EXAMPLE 1

New-ConsoleAlign -Content { }

Parameters

-Content ScriptBlock optionalposition: 0
Scriptblock that emits the content (several widgets are stacked vertically).
-Fill SwitchParameter optional
Take the remaining height of a live dashboard.
-Height Int32 optional
Fixed height in rows.
-Horizontal HorizontalAlignment optional
Horizontal placement: Left, Center (default) or Right.
Possible values: Left, Center, Right
-Vertical VerticalAlignment optional
Vertical placement: Top (default), Middle or Bottom.
Possible values: Top, Middle, Bottom
-Weight Double optional
Share of the width (in columns) or height (in a live dashboard) this widget takes.
-Widget IWidget optionalpipeline: True (ByValue)
A widget to align instead of a scriptblock.

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.