The big problem with Powershell, and it makes it borderline unusable on Linux, is its crazy error handling. The equivalent of bash's `set -e` is `$ErrorActionPreference="Stop"`.
The problem is that it treats any output to stderr as an error and ignores actual posix errors (non-zero exit codes.) What's worse is in some contexts the error it throws on stderr is impossible to catch.
I really love Powershell in a lot of ways but this makes a lot of really basic scripts in bash very cumbersome to write in Powershell.
Do you have any examples of stderr errors being impossible to catch in PS, and/or a basic script that is very easy in Bash but cumbersome in PowerShell?
Recently I was trying to automate something with gsutil (Google's storage CLI) using Powershell remoting to a Windows host. gsutil is a totally well-behaved posix app, which emits status information to stderr. The bug is specifically that when using remoting (Windows equivalent of ssh) the error is uncatchable.
Ultimately I just want Powershell to handle well-behaved posix apps in a sane way, but honestly the reaction of some of the people on the thread seems like there's a huge cultural gap between Microsoft and the Posix community. (Which, Microsoft claims to be a part of but clearly is not.)
The problem is that it treats any output to stderr as an error and ignores actual posix errors (non-zero exit codes.) What's worse is in some contexts the error it throws on stderr is impossible to catch.
I really love Powershell in a lot of ways but this makes a lot of really basic scripts in bash very cumbersome to write in Powershell.