This is a function to change encoding of a file:
1 2 3 4 5 6 7 8 |
function ChangeEncoding($file , $encoding = "ascii") { # Encoding could be ascii, utf8, utf7, Unicode, etc. $tempFile = "$($file).temp" gc $file | out-file -encoding $encoding $tempFile remove-item $file Rename-Item $tempFile $file } |