Skip to content
ConsoleMonster
Cmdlet

New-ConsolePadding

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

Adds empty space around console widgets.

Syntax

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

Description

Adds empty space around console widgets.

-Padding takes one, two or four numbers of cells: all sides; left and right, then top and bottom; or left, top, right and bottom (the order of the .NET Padding widget). Strings in the script block are markup text. Use New-ConsoleAlign to place content inside its space instead.

Examples

Authored help example

EXAMPLE 1

New-ConsolePanel -Title 'Padding' { New-ConsolePadding -Padding 2, 1 { 'two cells of padding' } } | Write-ConsoleWidget

Two cells left and right, one row above and below

EXAMPLE 2

New-ConsolePadding -Padding 4, 0, 0, 0 { New-ConsoleText -Markup '[muted]indented note[/]' } | Write-ConsoleWidget

Indent a block by four cells

Parameters

-Content ScriptBlock optionalposition: 0
Script block 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.
-Padding Int32[] optional
The space in cells: one value for all sides; two for left and right, then top and bottom; four for left, top, right and bottom (default 1, 0: one cell left and right).
-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 pad instead of a script block.

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.