I believe I have something that I can work with!
this is change.ps1:
(Get-Content "C:\file\settings.xml") | Out-File -Force -Encoding
BigEndianUnicode "C:\file\settings.xml"
In another script, I have xcopy copy the above script to a temp
directory and then with psexec, I execute this:
bin\psexec -accepteula -nobanner -u %USER_NAME% -p %PASSWORD% \\%%A
powershell -inputformat none -ExecutionPolicy ByPass -File
"\\%%A\c$\temp\bin\change.ps1"
the various variables are set at the top of the script, as usual.
The out-file encoding doesn't care what the current format is so I don't
have to worry about like I was was iconv.
Of course this may fail on Windows XP machines, but if powershell.exe is
just a single binary, maybe I can ship it with my script and it will
work. I don't know if that's the case, seems too easy to be true.
Thanks for the pointers to powershell and iconv!