© 2026 Start-Automating
Escape sequences are a nearly unavoiable part of technology.
We often need to escape strings into other formats
(like putting < or > inside of HTML).
We also often need to use more obscure escape sequences to adjust terminal settings.
Escape is a collection of escape sequences, and the way to escape having to remember them.
Escape is a collection of scripts that make escape sequences.
It has a relatively simple architecture:
- Each script resides in
./Types/Escape.Sequence. - All scripts are compiled into ScriptMethods by EZOut.
Get-Escapeexposes all of these scripts with natural syntaxGet-Escapeis aliased toescapeandescfor easier-to-read syntax
While Escape has over a hundred sequences, it is nowhere near a complete collection.
To help make it a better one, please consider contributing
You can install this module from the PowerShell gallery
Install-Module Escape -Scope CurrentUser -ForceOnce installed, you can import the module with:
Import-Module Escape -PassThruYou can also clone the repo and import the module locally:
git clone https://github.com/StartAutomating/Escape
cd ./Escape
Import-Module ./ -PassThruEscape has 1 function
Get Escape
Bolding text
escape bold boldText resetItalic text
escape italic italicText resetBold and italic text
escape bold italic boldAndItalic resetCrossed out text
escape crossout "crossed out" resetUsing standard foreground colors
escape foregroundRed r foregroundGreen g foregroundBlue b resetEscape HTML content
escape html "a > b"Escape html attributes
escape htmlAttribute "'a' -gt 'b'"Escape XML content
escape xml "a > b"Show primary console colors
"$(
escape underline overline
foreach ($n in 0..15) {
escape foregroundColor $n $n
}
escape reset
)"Display the 256 standard xterm colors
@(
foreach ($n in 0..255) {
"$(escape bold foregroundColor $n $n)"
}
escape reset
) -join "`t"Display the 256 standard xterm colors (using a prototype is faster than using natural syntax)
$escape = [PSCustomObject]@{PSTypeName='Escape.Sequence'}
$escape.bold()
@(
foreach ($n in 0..255) {
"$($escape.foregroundColor($n)) $n"
}
$escape.reset()
) -join "`t"RGB
escape foregroundRed r foregroundGreen g foregroundBlue b resetRGB bold and italic
escape bold italic foregroundRed r foregroundGreen g foregroundBlue b resetRGB bold italic underline overline
escape underline overline bold italic foregroundRed r foregroundGreen g foregroundBlue b resetThe Notorious RBG
escape underline overline bold italic "The Notorious " foregroundRed R foregroundBlue B foregroundGreen G resetTerminal Rainbow
escape @(
"bold"
"foregroundBrightRed", "r"
"foregroundBrightYellow", "a"
"foregroundYellow", "i"
"foregroundGreen", "n"
"foregroundBlue", "b"
"foregroundBrightPurple", "o"
"foregroundPurple", "w"
"reset"
)Terminal Reading Rainbow
@(
"Reading "
"bold"
"foregroundBrightRed", "R"
"foregroundBrightYellow", "a"
"foregroundYellow", "i"
"foregroundGreen", "n"
"foregroundBlue", "b"
"foregroundBrightPurple", "o"
"foregroundPurple", "w"
"reset"
) | escapeEscape Konami Code (will not do anything in any terminal, just having fun)
escape @(
'cursorUp',1 ,'cursorUp',1
'cursorDown', 1, 'cursorDown', 1
'cursorBackward', 1, 'cursorForward',1
'cursorBackward', 1, 'cursorForward',1
'b'
'a'
'start'
)