I have a rather large XML file that I need to replace some connection strings within.
I use the following code to replace the strings:
$temp = Get-Content .\bigxmlfile.xml
$temp.replace("STRING1","STRING2") | out-file .\bigxmlfile.xml -force
This changes the strings just fine but for some reason ALWAYS ends up breaking the XML. I'm having trouble figuring out why.