Hacker News new | ask | show | jobs
by zwischenzug 117 days ago
Isn't that because of posix?
1 comments

Powershell is not posix compliant and does not pretend to be. Like conditionals using `()` instead of `[]` is already a clear departure from posix
Don't know if this is definitive, but:

https://www.johndcook.com/powershell.html#:~:text=The%20core...

POSIX Korn shell, specifically, according to Wikipedia:

https://en.wikipedia.org/wiki/PowerShell#Grammar

so maybe it inherited 2>&1 from Korn shell, which in turn was POSIX.

But yeah, Powershell was not built purely to be a POSIX shell, but I thought it tried to be compatible where it made sense (hence the seeming clash of cultures).

I don't think they were talking about pwsh? pwsh actually has types and is its own programming lang unlike *sh, so it doesn't rely on builtin command exit codes.