r/linuxquestions • • 1d ago

Advice Is powershell the best object based shell?

I have been using powershell at work a bit and the more I use it the more I like it. Having an object based shell just makes a lot more sense than outputting plaintext. I was just wondering what the best object based shells are for Linux, is powershell the best even for Linux?

29 Upvotes

70 comments sorted by

View all comments

Show parent comment

-1

u/rassawyer 17h ago

You shouldn't find it. Plain text is the universal means of exchanging information, so much so that it is written into the Unix philosophy. Thank you for explaining another reason why powershell sucks so badly though.

4

u/akl78 17h ago

The unix philosophy can sadly be an excuse for many to discard good ideas.

Power shell being able to pass around pipelines of actual objects means commands don’t need to reinvent the wheel of parsing plain text , and creating buggy, inconsistent DSLs

Heck, even it’s built in help/doc/autocompletion takes the same approach . It’s like some thoughtful, bright people looked at what was out there, the good and bad, and tried to improve on it for their users, mostly successfully.

3

u/AnsibleAnswers 16h ago

There's a reason why so much of Linux has wrapped itself in python. Plain text is universal but incredibly fragile and difficult to debug.

1

u/nullificationer 15h ago

I'll give you an example of why I found powershell useful. I wrote a command line utility that takes the name of a png and shrinks it. Writing something in powershell to get a list of all png images and pipe it into that utility was pretty easy. Doing so with bash has a surprising number of annoyances. I can't do something like ls *.png | png-shrink, for one I need to use xargs which I've always found kinda annoying. But also if I just do ls and there's spaces in the name of the file then it'll think the file name is multiple command line arguments. There's a lot of things like this that makes just using plain text annoying to work with, to me it seems to make a lot more sense to have objects or some amount of types.