Powershell Editing Xml causing Visual Studio to report Inconsistent Line Ending

viagra cialis

New Member
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 \[code\]<!--<foo> <bar> </bar></foo>-->\[/code\]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\[code\]<!--foo-->\[/code\]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\[code\] [xml]$xml = gc $xmlFileLocation -encoding utf8 $xml.Save($xmlFileLocation)\[/code\]I've also tried something along the lines of \[code\] set-content -encoding utf8 $xmlFileLocation $xml.outerXml\[/code\]But I keep on getting this message...Any sugguests/help would be much appreciated.
 
Back
Top