Thursday, February 26, 2009

Powershell Encoding - Grep

I was writing something where powershell ran on the remote host and copied files to a second box. On the second box I would run a perl script and take any any lines containing "Time:" "Finished zone:", had trouble.

Found out that
cmd - "dnscmd /zoneprint > "
powershell - "dnscmd /zoneprint > "

give files with different encoding.

I ended up using | Out-file -Encoding utf8

No comments: