Skip to main content

Variable: POWERSHELL_ASCII_ESCAPE_FUNCTION

const POWERSHELL_ASCII_ESCAPE_FUNCTION: "function ConvertTo-AsciiEscaped([string]$text) { if ($text -cmatch '[^\x00-\x7F]') { -join $(foreach ($c in $text.ToCharArray()) { if ([int]$c -gt 127) { '\u{0:x4}' -f [int]$c } else { $c } }) } else { $text } }" = "function ConvertTo-AsciiEscaped([string]$text) { if ($text -cmatch '[^\x00-\x7F]') { -join $(foreach ($c in $text.ToCharArray()) { if ([int]$c -gt 127) { '\u{0:x4}' -f [int]$c } else { $c } }) } else { $text } }"