I'm trying to tee
a server's output to both the console and a file in Powershell 4. The file is ending up with a UTF-16 encoding, which is incompatible with some other tools I'm using. According to help tee -full
:
Tee-Object uses Unicode enocding when it writes to files.
...
To specify the encoding, use the Out-File cmdlet
So tee
doesn't support changing encoding, and the help for both tee
and Out-File
don't show any examples of splitting a stream and encoding it with UTF-8.
Is there a simple way in Powershell 4 to tee
(or otherwise split a stream) to a file with UTF-8 encoding?