3 ms·
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, bot
by OkayPhysicist 3y ago
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.
- jborean93 3y ago> 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.
- wvenable 3y agoYeah 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.
- fr4nkr 3y agoPowershell 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.
- spiralx 3y agoIt was actually inspired by Perl as much as Bash if you read one of the asides in the O'Reilly book written by one of PS's developers lol.