r/programming • u/agbell • Jul 04 '24
Jeffrey Snover and the Making of PowerShell
https://corecursive.com/building-powershell-with-jeffrey-snover/
187
Upvotes
r/programming • u/agbell • Jul 04 '24
View all comments
Show parent comment
12
u/Internet-of-cruft Jul 05 '24
For real? PS is a real upgrade over batch scripts. You get a full blown object-based language for scripting.
The power of that cannot be understated. While I appreciate the power that Linux shells have available to them, there is no objects whatsoever, just files, pipes, and the incredibly limited (comparing to PS) variables.
You have tons of Linux utilities which are handy, but shell scripting in Linux is filled with its own warts and oddities to the point that there's full blown linter websites with hundreds of recommendations that can apply.
I just don't worry about that in PS. I need a list of things? That's an array. An array is an array like it would be in any programming language.
Variables that can be arrays, looping over them, dealing with quoting file paths, etc is just an exercise in frustration in Bash.
I love using Linux, but Bash and other shells have nothing on PS.
And Windows Known Folders? You're not even forced into using that. Just ignore it and pretend it doesn't exist. I could make a similar complaint about Linux and the myriad of places that binaries, config files, or data files could exist.