Skip to content

Format-SpectreAligned

Description

This wraps a renderable object in a Spectre Console Aligned object. This allows you to align the object horizontally and vertically within a space. Aligned objects are always expanded so they take up all available horizontal space.


Examples

Example 1
This example demonstrates how to align a string to the right inside a panel.

"hello right hand side" | Format-SpectreAligned -HorizontalAlignment Right -VerticalAlignment Middle | Format-SpectrePanel -Expand -Height 9

Parameters

Data

The renderable object to align.

TypeRequiredPositionPipelineInput
[Object]true1true (ByValue)

HorizontalAlignment

The horizontal alignment of the object.

Valid Values:

  • Left
  • Center
  • Right
TypeRequiredPositionPipelineInput
[String]false2false

VerticalAlignment

The vertical alignment of the object.

Valid Values:

  • Top
  • Middle
  • Bottom
TypeRequiredPositionPipelineInput
[String]false3false

Syntax

Format-SpectreAligned [-Data] <Object> [[-HorizontalAlignment] <String>] [[-VerticalAlignment] <String>] [<CommonParameters>]