Tag Info

New answers tagged

0

Have you tried using Import-CLIXML instead of Get-Content? I don't know how well it handles big or complex xml files, but it's worth a shot.


1

If you process XML using non-XML-aware tools, you will always run this risk. If you want to do a transformation on XML, the best tool for the job is the XML transformation language, XSLT.


2

Out-File is writing a Unicode file by default. Use -Encoding to fix it: $temp = Get-Content .\bigxmlfile.xml $temp.replace("STRING1","STRING2") | out-file .\bigxmlfile.xml -force -encoding ascii Alternatively, use Set-Content: $temp = Get-Content .\bigxmlfile.xml $temp.replace("STRING1","STRING2") | set-content .\bigxmlfile.xml -force



Top 50 recent answers are included