Re:PowerShell: The object-oriented shell you didn't know you...
by OkayPhysicist on Monday April 29, 2024 @07:41PM
(#40205553)
I like PowerShell a lot more than bash, but it's got so much weird jank. String escaping gets pathological when passing arguments to cmd, or bash, or worse, both, which happens more than you'd think (looking at you, Azure CLI), and there's no good way to pipe raw bytes around (like, say, when you want to checkout a binary file from git). There's no real need to differentiate between HashTables and Objects, but it does, and it bites you at random times. IMO, they would have been better off dropping the < and > piping operators, leaving them as | Out-File and Get-Content | and then used the arrows for less than and greater than, and used == as equal to, instead of the -lt -gt -eq nonsense.
[ Parent
| on HN ]
Re:PowerShell: The object-oriented shell you didn't know you...
by jborean93 on Monday April 29, 2024 @07:44PM
(#40205570)
> and there's no good way to pipe raw bytes around (like, say, when you want to checkout a binary file from git).
Since pwsh 7.4 it can natively pipe the raw bytes between two external binaries and also when redirecting to a file. Sucks it took until then to get it but it's now there.
Re:PowerShell: The object-oriented shell you didn't know you...
by wvenable on Monday April 29, 2024 @07:49PM
(#40205622)
Yeah this my main complaint with Powershell -- Microsoft had one opportunity to build a new shell for the ages and decided to use Bash for syntax inspiration. It could have been so much better and now we're stuck with it forever.
Re:PowerShell: The object-oriented shell you didn't know you...
by fr4nkr on Monday April 29, 2024 @08:42PM
(#40206053)
Powershell feels a lot like Microsoft wanted to appeal to *nix users, especially system administrators, without really understanding them, presumably because D̶a̶v̶e̶ ̶C̶u̶t̶l̶e̶r̶ ̶s̶h̶o̶t̶ ̶t̶h̶e̶m̶ ̶o̶n̶ ̶s̶i̶g̶h̶t̶ Microsoft's way of doing things was and is considerably different. As a result, it hadn't really occurred to them that much of bash's weirdness and flakiness is historical, not simply because *nix users prefer it that way.
The end result was still a much better language than bash, of course, but that's a very low bar.