Powershell beginner here..
So I've created a Nuget package with a powershell script. The powershell script modifies a xml schema inside my Visual Studio project when it gets installed. Problem being....
If there's a multi-line block comment inside the xml file like
<!--<foo>
<bar>
</bar>
</foo>-->
After the script is run Visual Studio pops up a message and says my file has "inconsistent line ending......"
If there is no comment, or if there is a single line comment like
<!--foo-->
There is no problem. Somehow the line ending in the block comment is changed from CRLF to something else by the powershell functions.
This is my powershell script for loading and saving the xml file
[xml]$xml = gc $xmlFileLocation -encoding utf8
$xml.Save($xmlFileLocation)
I've also tried something along the lines of
set-content -encoding utf8 $xmlFileLocation $xml.outerXml
But I keep on getting this message...
Any sugguests/help would be much appreciated.