powershell - tee with utf-8 encoding -
i'm trying tee
server's output both console , file in powershell 4. file ending utf-16 encoding, incompatible other tools i'm using. according help tee -full
:
tee-object uses unicode enocding when writes files.
...
specify encoding, use out-file cmdlet
so tee
doesn't support changing encoding, , both tee
, out-file
don't show examples of splitting stream , encoding utf-8.
is there simple way in powershell 4 tee
(or otherwise split stream) file utf-8 encoding?
one option use add-content
or set-content
instead of out-file
.
the *-content
cmdlets use ascii encoding default, , have -passthru
switch can write file, , have input pass through console:
get-childitem -name | set-content file.txt -passthru
Comments
Post a Comment