Bug: wrong encoding in some *.format.ps1xml files
It's probably useless and a shame that M$$ is usually not fixing this kind of bugs:
Some PowerShell xml Files have the wrong encoding, for example this one:
It states that it is using:
<?xml version="1.0" encoding="utf-8" ?>
but in fact, it's utf-16.
$xmldoc = New-Object xml.XmlDocument
Exception calling "Load" with "1" argument(s): "'.', hexadecimal value 0x00, is an invalid character. Line 2, position 1."
Change the header to:
<?xml version="1.0" encoding="utf-16" ?>
and it will work.
M$ still does not have the most basic unit tests to assure that config files must have the right encoding?
Shame on you, M$$!
It's even worse: M$$ must have developed code to workaround this bug - otherwise, PowerShell would raise an exception because .Net is crashing.