MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/PowerShell/comments/r3wcv4/bash_vs_powershell_cheat_sheet/i1lwb13/?context=3
r/PowerShell • u/[deleted] • Nov 28 '21
17 comments sorted by
View all comments
2
I prefer "add-content" over ">>" for appending to a file. >> appends in utf16 format, and doesn't check what the current format is, so it can mix utf8 and utf16 in the same file.
1 u/MonkeyNin Mar 22 '22 Yep. Using >> in Windows Powershell doesn't care what the file's encoding isUsing >> In powershell defaults to utf8This config will help mitigate most of the crazy encoding defaults in windows powershell.https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_character_encoding?view=powershell-7#changing-the-default-encoding
1
Yep. Using >> in Windows Powershell doesn't care what the file's encoding is
>>
Windows Powershell
Using >> In powershell defaults to utf8
powershell
This config will help mitigate most of the crazy encoding defaults in windows powershell.
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_character_encoding?view=powershell-7#changing-the-default-encoding
2
u/jsiii2010 Nov 29 '21
I prefer "add-content" over ">>" for appending to a file. >> appends in utf16 format, and doesn't check what the current format is, so it can mix utf8 and utf16 in the same file.