Reply to post: Re: Need a new book

Open-source, cross-platform and people seem to like it: PowerShell 7 has landed

gryphon

Re: Need a new book

Umm.

Sort of.

It's more often used in something like this

get-disk | where-object {$_.PartitionStyle -eq "MBR" | ft number, friendlyname

So you are getting details of all your disks as objects, looking within each object for the PartitionStyle equaling MBR and displaying some other info about the disk

For disk you could also do $_.Model, $_.NumberOfPartitions, $_.Size and so on

I've read a few articles that describe $_ as the variable of the pipeline if that makes more sense.

i.e. get-disk puts the disk objects into the pipeline and you can then look up their values using $_

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon