r/PowerShell • • Nov 28 '21

Bash vs PowerShell Cheat Sheet

https://blog.ironmansoftware.com/daily-powershell/bash-powershell-cheatsheet/
142 Upvotes

17 comments sorted by

View all comments

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.

1

u/MonkeyNin Mar 22 '22

Yep. Using >> in Windows Powershell doesn't care what the file's encoding is

Using >> In powershell defaults to utf8

This config will help mitigate most of the crazy encoding defaults in windows powershell.