I get what you’re saying but the other weird limitations of powershell as well as microsoft’s strangely abusive security relationship with powershell makes it a non-starter for me, or at least makes me hesitate a ton before putting effort into a ps script since even in the same AD orgs which in theory have the same gpos applied across all machines, it’s a crapshoot if the ps script will even execute without having to trick windows into allowing it to run. object oriented nature of ps is also a curse as much as blessing as simple text parsing or iterating over files on a system are very slow compared to bash, never minding that from my experience it’s a crapshoot on how well a given ps module handles strings and how that will be reflected in the script.
(e.g., one company’s ps module doesn’t handle square brackets ][ well and for an inexplicable reason the normal ps escaping does not work as advertised, requiring more backticks than usual and a different number depending on if you “” or ‘’ the input string. As best i can tell its joint fault of ps bug and poor module design but had no luck convincing the vendor to adjust their design because “it will break existing scripts”, which is a valid concern but it also means writing automation for their product is a headache since you’re going to see ][ in production environments as is a visually obvious delimiter when humans are reading it)
It seems like a good idea but breaks down, a shell is text for good reasons.
Psh is ok in Windows land on Microsoft tools, but IMO you might as well use Python if you want those features. I run the same bash script on five platforms while the power of bash disappears when you do not have all the 3rd party tools and Unix kernel, it is still easy to write and execute fast.
That said the idea of power shell is great I use it from bash on Windows for very limited things. As a shell to integrate stuff not so much.
POSIX Shell is text for good reasons, but file names aren't (necessarily) text. So POSIX shells aren't very well-suited to dealing with file names, requiring arcane hackery to be portable & safe. It'd be easier with any sort of type system to distinguish file names from text, object orientation isn't necessary at all.