PowerShell is natively Unicode. When you use the ">" or ">>" convenience methods to write to a file, the file is Unicode encoded. This isn't a problem until you want to use the resulting text file in a program that only understands ASCII. I found this with SQL*PLUS. The solution is to either use the
Out-File –FilePath
full cmdlet rather than the ">" for each write statement or copy the file after it's produced:
Get-Content –LiteralPath
Enjoy!
No comments:
Post a Comment