When running a simple echo é through winrm-elevated, the output I get back is badly corrupted. There are actually two corruptions:
We upload the script to execute as a UTF-8 file, but Windows reads it as ANSI because that’s its default encoding.
When cmd.exe writes the output files, its default encoding is OEM, but PowerShell reads them later as ANSI.
Adding a BOM to the beginning of the input script fixes 1, and explicity telling PowerShell to use the OEM encoding when reading the output file fixes 2.
Characters not representable as ANSI or OEM are transliterated.
When running a simple
echo é
through winrm-elevated, the output I get back is badly corrupted. There are actually two corruptions:Adding a BOM to the beginning of the input script fixes 1, and explicity telling PowerShell to use the OEM encoding when reading the output file fixes 2.
Characters not representable as ANSI or OEM are transliterated.