LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Blogs > Musings on technology, philosophy, and life in the corporate world
User Name
Password

Notices


Hi. I'm jon.404, a Unix/Linux/Database/Openstack/Kubernetes Administrator, AWS/GCP/Azure Engineer, mathematics enthusiast, and amateur philosopher. This is where I rant about that which upsets me, laugh about that which amuses me, and jabber about that which holds my interest most: *nix.
Rating: 3 votes, 5.00 average.

Windows PowerSh**

Posted 08-12-2014 at 10:40 AM by rocket357
Updated 08-12-2014 at 11:15 AM by rocket357

grep is such a simple concept. You have a stream of text lines, and you look for lines in the output that match a pattern. Really, really simple.

Take the following, for example:

some-command | grep 'pattern'

I know this is difficult to understand because it's overly complex, but that's how things work on *nix.

Try doing that on PowerShell. You end up with something like:

(some-command|out-strings -stream) | select-strings 'pattern'

Yes, that's basically saying "I don't want the PowerShell **objects**, I'd just like their textual representation on the screen, and then I'd like to search through said strings for the pattern I'm looking for."

WTF? Why construct objects in the background, ONLY TO RUN toString() ON THEM TO PRINT THEM TO SCREEN!??! What the @#(*&$ do you gain?!?

Even better are the PowerShell numbnuts who have never used a real shell before telling you "you're doing it wrong, you should use the PowerShell objects!".

No, that's cool. I wanted to "some-command | grep 'pattern'" so I could see, in under 0.5 seconds, what version of $some_software is running. But instead, I think I'll take your advice and write a 375 line script that recurses through PowerShell object hell just so I can toString() something 700 objects deep so I can see what version of $some_software is installed.

Here's what I have to say to that:

Screw you idiots, screw Microsoft, and screw PowerShell. You are all mad.

BSD is what happens when Unix programmers port Unix to the x86. Linux is what happens when x86 programmers write a Unix-like. And Windows is what happens when x86 programmers run all of their programming textbooks through a blender, eat the ground up remains of the text, and then code what they read in the toilet 3 days later.
Posted in Uncategorized
Views 536 Comments 2
« Prev     Main     Next »
Total Comments 2

Comments

  1. Old Comment
    Recently a friend was telling me as his job, they recently tasked him with going through a ton of records, stored in plain text.

    I asked him what OS they were using. Of course, I already knew the answer. Windows.

    I told him how sorry I felt for him. I tried to introduce him at least to cygwin to help. He wouldn't hear it.

    Oh well, it's going to be a few long days or weeks for him.
    Posted 08-12-2014 at 11:14 PM by goumba goumba is offline
  2. Old Comment
    Ouch. It's definitely better than it used to be, but PowerShell has a **long** ways to go before it's efficient enough to be usable, IMHO.
    Posted 08-13-2014 at 10:01 AM by rocket357 rocket357 is offline
 

  



All times are GMT -5. The time now is 05:36 PM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration