← Back to context

Comment by delta_p_delta_x

2 days ago

PowerShell needs to become more ubiquitous. There are so many things about it that once considered in greater detail make so much sense. Parameter setup, typing, and naming. Flow control. Object-oriented scripting. Built-in parsing for recursive data types like JSON, HTML, XML.

And in my opinion, the most slept-on: the fact it runs on the CLR and direct access to .NET objects and types which means access to P/Invoke and thence the Windows API. One can write business logic in the fast language and write a nice CLI wrapper around that in the natural shell language, and not worry about painful FFI unlike everyone else trying to fit Python or Bash into whatever world they're using.

The typical counter to this will be: PowerShell is verbose, PowerShell used `curl` as an alias to Invoke-WebRequest instead of the Real Thing™. Neither are real arguments.

I'm curious, have any good examples of projects in the ~1K LOC range of PowerShell, so I could get a taste for how something like that would look like? Beyond that I tend to go for "real" programming languages, or just start with Babashka, but still curious to see projects other PowerShell fans would consider "well written/designed" :)

  • It never gets old - the number of times I have to roll my eyes and chuckle whenever someone "shares bash tricks" (like the OP) or says stuff like "powershell needs to become more ubiquitous" on HN. Seriously, have you folks not been vexed sufficiently with these things? Both bash/zsh and powershell are enormously frustrating and quirky in real, practical tasks. babashka in comparison is so much more pragmatic, simple and straightforward. I really don't want to become an expert in whatever - be that bash, powershell or anything else, I just want to get the shit done, I don't want to learn "tricks" and "magic", I just want to be able to close my laptop at 5PM and stop thinking about work. How the heck have we normalized "intellectual complexity" instead of "stupid simplicity", I still don't get it.