4 ms·
Helge Klein wrote an excellent article "What I Hate About PowerShell": https://helgeklein.com/blog/2014/11/hate-powershell/ https://helgeklein.com/blog/2014/11/
by bloblaw 10y ago
Helge Klein wrote an excellent article "What I Hate About PowerShell": https://helgeklein.com/blog/2014/11/hate-powershell/ https://helgeklein.com/blog/2014/11/hate-powershell/
Be sure to read the comments where PowerShell guru Jeffrey Snover politely addresses them.
I share many of these same frustrations that have prevented me from adopting it as a Windows scripting language. I use it when I have to, but I still will choose csharp compiled EXE's, vbscript, or even Py2Exe'd Python programs over PowerShell for sysadmin type tasks.
I was in the audience at MS TechEd 2005 in Orlando and watched as Jeffrey Snover presented Monad and highlighted it's Perl, awk, sed, and unix influences. I was immediately impressed.
However, PowerShell seems to best fit as a REPL shell, and for me, more mentally cumbersome than using csharp (which of course can technically do everything ps can).
My gripes with PS are kind of minor (a bit like my dislike of Python's whitespace enforcement), but it's kind of like a death by a thousand annoyances with PowerShell for me.
For example (stolen from Helge's article), these are some WTF's for me
* Testing for string equality: "abc" -eq "abc"
( why isn't this "abc" == "abc" )
* Greater than: 8 -gt 6
( why isn't this 8 > 6 ?)
* Functions can only be used after being defined. Leading to scenarios where a script begins waaaay down at the bottom.
* dynamic scoping: http://ig2600.blogspot.de/2010/01/powershell-is-dynamically-scoped-and.html http://ig2600.blogspot.de/2010/01/powershell-is-dynamically-...
* No way to syntax check a PS script before it's run
These aren't all major, but the last one is a show-stopper for me. If I'm running a script on a couple hundred thousand machines (and I have) I can't afford to have my script bail out on an unexpected code-path.
I really like the idea of PowerShell, and I am honestly glad it exists, but I think it would benefit from some changes outlined in Helge's article.
And this is why me, someone working professionally with Windows for over 15 years (sysadmin, developer, security) doesn't choose to use PowerShell very often.
- thoth 10y ago> * Greater than: 8 -gt 6 ( why isn't this 8 > 6 ?) Wouldn't that be ambiguous with ">" when used for redirecting IO?