I've never really seen PowerShell beyond minimal commands, but after seeing the parent, I definitely think it has the superior syntax of the shells. Especially for scripts.
I expected to like Powershell when I began working somewhere with a lot of Windows (after decades of mostly Linux). I figured on paper this sounds like it has learned many important lessons that Unix shells could learn but (at least the popular ones) didn't, it's been given a blank canvas, the principles it's working to make sense, it has good people behind it. So I even undertook to write a modest new piece of glue code in Power Shell, after all if it had been on Linux I'd definitely consider the Bourne shell as well as Python for the work...
Then I tried it and I strongly dislike it. The syntax is clunky, it's really no better than popular Unix shells at being a "real" programming language, and yet it's not as good as they are at being just a shell either.
It also just doesn't feel like a quality product. On my work Windows laptop, Powershell will sometimes not quite bother flushing after it starts, so I get the banner text and then... I have to hit "enter" to get it to finish up and write a prompt. In JSON parsing the provided JSON parser has some arbitrary limits... which vary from one version to another. So code which worked fine on machine #1 just silently doesn't work on machine #2 since the JSON parsers were changed and nobody apparently thought that was worth calling out. If you told me this was the beta of Microsoft's new product I'd be excited but feel I needed to provide lots of feedback. Knowing this is the finished product I am underwhelmed.
I find the built-in commands rough. "curl https://jrock.us" to see if my website is up used to involve opening Internet Explorer to accept some sort of agreement. Now it just flashes the terminal, moves the cursor to the far right hand side of the screen, and blinks for a while. I like the Linux version of curl better...
As it turns out, the reason that "curl ..." doesn't work is because it pops up a window below all of my other windows saying that certificate revocation information is unavailable, and would I like to proceed. After that it does download my web page!
> It also just doesn't feel like a quality product. On my work Windows laptop, Powershell will sometimes not quite bother flushing after it starts, so I get the banner text and then..
That’s independent of the shell, and is I believe a bug in the terminal emulator. There is an open source Windows Terminal you can separately install and that is so much better.
Nope, windows terminal definitely does this too. Just last week I was trying to install WSL, and thought it had frozen at 20% and was trying to figure out what went wrong ... turns out it had already booted but powershell had stopped flushing output.
A lot of people sleep on PowerShell, possibly because some of the syntax is a little clunky (and quite slow compared to some other shells, I will freely admit). That being said, I'd argue object oriented programming is a massive improvement over text oriented programming. I never want to touch awk again!
The only thing making it less than a total win is its handling of piped errors and `set -e`. The programming model itself is far superior to 'stringly-typed' sh.
PowerShell is the worst of all worlds. Its a terrible shell compared to bash/zsh/whateversh, and for anything complex enough to need a long script you’re far better off in Python.