Quantcast
Channel: Hey, Scripting Guy! Blog
Viewing all articles
Browse latest Browse all 3333

PowerTip: Control Text-File Encoding with PowerShell

$
0
0

Summary: Learn how to control text-file encoding with Windows PowerShell.

Hey, Scripting Guy! Question How can I ensure that a file is encoded with Unicode when I write to it?

Hey, Scripting Guy! Answer Use the Out-File cmdlet, and specify the appropriate value for the –Encoding parameter:

Get-Process | Out-File -FilePath c:\fso\myfile.txt -Encoding unicode


Viewing all articles
Browse latest Browse all 3333

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>