d3Xt3r
4 hours ago
Windows sysadmin here. PowerShell has been great for a long time, well, since at least v5.1, when they finally fixed many of the annoying issues and limitations of earlier versions. I practically live in it the whole day - 90%+ of my work life is in PowerShell these days.
But I question its utility on other platforms, because a lot of the things that makes PowerShell cool on Windows doesn't actually work in Linux or macOS.
Eg: Get-Service (and associated cmdlets). Very handy cmdlet that I use all the time on Windows. On Linux, you'd expect that it'd work with systemd units, but no, that command doesn't exist on the Linux version. Same with Get-NetAdapter, or Get-NetTCPConnection, or Get-Disk and so many other handy cmdlets that I use all the time on Windows, are all missing.
Yet, some cmdlets do exist, like Get-Process or Get-Uptime etc, so I don't understand why many of the commonly used Windows cmdlets haven't been ported over.
Another annoying quirk is how PowerShell on *nix hands off some of the built-in aliases to their native versions. Like on Windows, I always use 'ls' because ain't nobody got time to type Get-ChildItem. Unfortunately when I run this on *nix PS, it runs the native version. And this is a problem because when I pipe 'ls' into a for loop or another cmdlet for further processing, it naturally, doesn't work. To make things worse, this native-or-alias decision making isn't even consistent. Like 'pwd' for example actually runs the PowerShell version, whereas 'echo' runs the native version.
Basically, as much as I love PowerShell on Windows, on *nix it is very annoying to work with. I would much rather work with native *nix shells and scripting languages. And if I really wanted the structured output of PS, I would run Nushell instead, which is far more consistent and useful than the half-baked product that *nix PowerShell is.
majkinetor
4 hours ago
You can fix that very easily in your linux profile (make ls call gci and not native tool). Just add alias in your profile. You cant really complain about the absence of some cmdlets on linux, and they are trivially easy to get implemented (or wrap native tools).
d3Xt3r
3 hours ago
I shouldn't have to do Microsoft's job. My point is that they put out a half-baked, nerfed shell for Linux, which is not cool. If they really wanted PowerShell to be taken as a serious, cross-platform shell, they should aim for 1-1 parity with the Windows version, or at least close to it. It's been 6 years since v7 came out, they've had plenty of time to do it.
If you want me to fix up Microsoft's slop, I'd rather contribute to a proper indie FLOSS project, like Nushell or something.
majkinetor
3 hours ago
Such a drama without a reason.
Its not slop for one. Take a look at repo and its practices. Its mind blowing and predates AI.
Nushell is nice, but lets not get carried away - it is decade away from pwsh, and suffers from the same things you complained, with language and semantics that are not intutive as pwsh's and not nearly as complete. Besides, so many 3rd party supports pwsh like Sql Server, VMware etc.
I agree that MS should push it way more and make Linux variant even better. The problem is that pwsh hardly surived at MS (cudos to Snover for being stuborn and worked against his position at MS to make it happen), and that needs some opinionated people working in MS who can fight this battle (I could honestly dedicate my life to this, I offer my services, for both pwsh and Windows, Microsoft!).
oblio
4 hours ago
Deployment, deployment, deployment.
The web was successful because the installation cost was 0.
majkinetor
3 hours ago
That is my only complaint really. Lets make it there... I beleive main offender is .net, but also main feature enabler.
tressure
4 hours ago
There’s also gci and dir. Both work as an alias for Get-ChildItem in all supported platforms. No need to use ls.
d3Xt3r
3 hours ago
ls is one letter shorter, and it's part of my muscle memory.
majkinetor
2 hours ago
sal ls gci >> $PROFILE
its faster then this discussion.
d3Xt3r
an hour ago
ls was just an example. There's tons more. I'm not going to test each and every command/alias/cmdlet and fix it so that it reaches parity with the Windows version. This is something Microsoft should have done so out of the box.
majkinetor
an hour ago
You are aware that there exist people who can want the opposite?
You can ask AI now to do it for you, you can probably find easily something somebody already did. It would have been nice if MS offered something that people can choose to install, but its far from a deal breaker like you seem to make it to be.
There is nothing to test, you want collection of aliases, that is trivial.
FWIW, they tried some things like https://github.com/PowerShell/Crescendo
d3Xt3r
40 minutes ago
As I said before, it's not just the aliases, it's all the cmdlets that are missing too, there's too many of them to list.
And why should I waste my AI tokens on fixing Microsoft's product? I'd much rather contribute my resources towards a fully open-source, indie project.
majkinetor
24 minutes ago
Because you are making it better for us, non MS people (its also already fully open source). I cant understand this way of thinking. Companies are not good or evil, they are abstract entities with people behind them and tones of regular users around. Besides, no fatureset will ever fit everybody, customization is a thing.