Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 230613

Re: Where filter with -like

$
0
0

You are doing the filter behind the Format-Table, that will not work I'm afraid.

You can add it to the Where-clause you already have, something like this

Get-VM | Sort Name | Where-Object {$_.PowerState –eq “PoweredOn”} |

Get-CDDrive | Where {!$_.IsoPath} | Select Parent,IsoPath

The 2nd condition checks the property IsoPath.

A property that has a value is interpreted as $true, an empty property ($null) is considered $false.

And with the '!" (or -not) operator we negate the expression, so we look for objects that have an IsoPath property that is empty.


Viewing all articles
Browse latest Browse all 230613

Trending Articles