 This is not the default behavior and must be enabled programmatically with the Win32 API via .This was enabled by CMD.EXE but not initially by PowerShell; however, Windows PowerShell 5.1 now enables this by default.The ability to make a string constant containing ESC was added in PowerShell 6 with (for example) ; for PowerShell 5 you had to use .