I need a PowerShell script that search in XML files for <?xml version="1.0" encoding="UTF-8"?> and remove it.
I tried:
(Get-Content $file) |
Foreach { $_ -Replace '<?xml version="1.0" encoding="UTF-8"?>', "" } |
Set-Content $file;
but it doesn't work.