Powershell Editing Xml causing Visual Studio to report Inconsistent Line Ending
Pipe Get-Content
through Out-String
:
[xml] $xml = Get-Content 'foo.xml' | Out-String
$xml.foo.bar = 'baz'
$xml.Save('foo.xml')
I just tested this: without Out-String
, I see the message in Visual Studio. With Out-String
, I don't, and comments are left alone.