Skip to content

Format-SpectrePadded

Description

This function that wraps a spectre renderable item in padding.
See https://spectreconsole.net/widgets/padder for more information.


Examples

Example 1
This example demonstrates how to pad an item with a padding of 1 on all sides

"Item to pad" | Format-SpectrePadded -Padding 1 | Format-SpectrePanel

Example 2
This example demonstrates how to pad an item with a padding of 4 on all sides

"Item to pad" | Format-SpectrePadded -Padding 4  | Format-SpectrePanel

Example 3
This example demonstrates how to pad an item with different padding on each side.

"Item to pad" | Format-SpectrePadded -Top 4 -Left 10 -Right 1 -Bottom 1 | Format-SpectrePanel

Parameters

Data

A renderable item to wrap in padding.

TypeRequiredPositionPipelineInput
[Object]truenamedtrue (ByValue)

Padding

TypeRequiredPositionPipelineInput
[Int32]truenamedfalse

Top

TypeRequiredPositionPipelineInput
[Int32]truenamedfalse

Left

TypeRequiredPositionPipelineInput
[Int32]truenamedfalse

Bottom

TypeRequiredPositionPipelineInput
[Int32]truenamedfalse
TypeRequiredPositionPipelineInput
[Int32]truenamedfalse

Expand

TypeRequiredPositionPipelineInput
[Switch]truenamedfalse

Syntax

Format-SpectrePadded -Data <Object> -Padding <Int32> [<CommonParameters>]
Format-SpectrePadded -Data <Object> -Top <Int32> -Left <Int32> -Bottom <Int32> -Right <Int32> [<CommonParameters>]
Format-SpectrePadded -Data <Object> -Expand [<CommonParameters>]