Get-SpectreEscapedText
Description
This function escapes text for use where Spectre Console accepts markup. It is intended to be used as a helper function for other functions that output text to the console using Spectre Console which contains special characters that need escaping. See https://spectreconsole.net/markup for more information about the markup language used in Spectre Console.
Examples
Example 1
This example demonstrates how to escape text for use in Spectre Console.
$data = "][[][red]]][[/][][]["
Format-SpectrePanel -Title "Unescaped data" -Data "I want escaped $($data | Get-SpectreEscapedText) [yellow]and[/] [red]unescaped[/] data"
Parameters
Text
The text to be escaped.
Type | Required | Position | PipelineInput |
---|---|---|---|
[String] | true | 1 | true (ByValue) |
Syntax
Get-SpectreEscapedText [-Text] <String> [<CommonParameters>]