this post was submitted on 29 May 2025
138 points (97.3% liked)

Linux

7626 readers
260 users here now

A community for everything relating to the GNU/Linux operating system

Also check out:

Original icon base courtesy of lewing@isc.tamu.edu and The GIMP

founded 2 years ago
MODERATORS
 

In the comments section of a recent post I found out that Windows PowerShell had been ported to Linux. Had no clue it was a thing.

Went looking and found this old article attempting to explain why they did it. Not remotely interested in giving up Bash for PowerShell, but I thought it was interesting enough to share. The article seems to be from 2016.

I have never been more tempted to check the NSFW box, but I'll leave it open for now unless a mod complains. :-D

you are viewing a single comment's thread
view the rest of the comments
[–] Irelephant@lemm.ee 39 points 1 week ago (55 children)

Powershell is annoyingly good though.

[–] JustEnoughDucks 2 points 1 week ago (4 children)

No grep though as far as I could find... There was a similar cmdlet IIRC, but it was extremely limited and didn't work well (this was years ago though)

[–] pezhore@infosec.pub 10 points 1 week ago (2 children)

The idea with powershell isn't to be a text parser - so grep doesn't really work. When you pass things through pipes, it's a full object with multiple properties, and those you can filter with either simple expressions like select-object [-property] or with more complex expressions: https://4sysops.com/archives/add-a-calculated-property-with-select-object-in-powershell/

[–] JustEnoughDucks 2 points 1 week ago (1 children)

Fair, but very very very often (unless you are a full time daily user of the commandlet and all objects you may run into or have a photographic memory) you don't know the actual specific property or object exact verbatim and have to rely on a very quick search to remember that one object you used 3 months ago once that you need now for example. Or you want to see where/if something is referenced in another subset of programs like a specific IP, another program, a resource taken up, etc...

That is mostly what grep is used for: discovery and reference, which powershell I don't think has a substitute for so instead you have to sort through documentation and forums.

[–] pezhore@infosec.pub 5 points 1 week ago

Not trying to be difficult, but that's what get-member is for - it'll dump all the properties for a given object.

I get it - it's way different from bash - speaking as someone who has been using Linux since Debian Hamm. Side note, net installers over dialup really sucked.

I was originally forced to use powershell when I joined up with a virtualization team for work and they used PowerCLI.

It was bonkers how easy it was to get reproducible scripts bundled up for the more junior engineers.

load more comments (1 replies)
load more comments (51 replies)