Skip to content

Instantly share code, notes, and snippets.

@aruku7230
Created February 8, 2023 06:03
Show Gist options
  • Save aruku7230/b03f7545bfb2ab27d2c859b75a5e6bfb to your computer and use it in GitHub Desktop.
Save aruku7230/b03f7545bfb2ab27d2c859b75a5e6bfb to your computer and use it in GitHub Desktop.
Poweshell character encoding

Set default encoding of Out-File. See about_Character_Encoding.

# On Windows Powershell
# Out-File and the redirection operators > and >> create UTF-16LE.
# Set defautl encoding of Out-File (or > redirection) to UTF-8 (with BOM).
$PSDefaultParameterValues['Out-File:Encoding'] = 'utf8'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment