Cmdlet
New-ConsolePadding
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 SetsDescription
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
EXAMPLE 1
New-ConsolePanel -Title 'Padding' { New-ConsolePadding -Padding 2, 1 { 'two cells of padding' } } | Write-ConsoleWidgetTwo 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-ConsoleWidgetIndent a block by four cells
Parameters
- -Content ScriptBlock
- Script block that emits the content (several widgets are stacked vertically).
- -Fill SwitchParameter
- Take the remaining height of a live dashboard.
- -Height Int32
- Fixed height in rows.
- -Padding Int32[]
- 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
- Share of the width (in columns) or height (in a live dashboard) this widget takes.
- -Widget IWidget
- 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.