Search notes:

System.Management.Automation.VTUtility (class)

System.Management.Automation.VTUtility has one overloaded method: GetEscapeSequence

PowerShell example

The following simple PowerShell example writes a line of text in which a word is highlighted:
$inv = [System.Management.Automation.VTUtility]::GetEscapeSequence( [System.Management.Automation.VTUtility+VT]::Inverse)
$rst = [System.Management.Automation.VTUtility]::GetEscapeSequence( [System.Management.Automation.VTUtility+VT]::Reset  )

write-host "This is $($inv)highlighted$rst text"
The type of $inv and $rst is string, and their values correspond to ANSI escape sequences:
PS C:\> $inv.GetType().FullName
System.String

See also

ANSI colors in PowerShell

Index