Skip to content

Format-SpectreTextPath

Description

Formats a path into a Spectre Console Path which supports highlighting and truncating.
See https://spectreconsole.net/widgets/text-path for more information.


Examples

Example 1
This example demonstrates how to format a PowerShell path as a Spectre Console Path with syntax highlighting.

Get-Location | Format-SpectreTextPath | Out-SpectreHost

Parameters

Path

The directory/file path to format

TypeRequiredPositionPipelineInput
[String]true1true (ByValue)

Alignment

Valid Values:

  • Left
  • Right
  • Center
TypeRequiredPositionPipelineInput
[String]false2false

PathStyle

TypeRequiredPositionPipelineInput
[Hashtable]false3false

Syntax

Format-SpectreTextPath [-Path] <String> [[-Alignment] <String>] [[-PathStyle] <Hashtable>] [<CommonParameters>]