VMware Cloud Community
afhamsani
Enthusiast
Enthusiast
Jump to solution

Filter options like Where { $_.Created

Hi guys,

This filtering option, where can i find it other properties?

Found this in Get-VM | Get-Snapshot | Where {$_.Created -lt (Get-Date).AddDays(-7)} | Remove-Snapshot

from the command above i understood about what it will do but what i'm looking for and try to understand is the filter object $_.Created, i assumed it has other option as well than $_.Created which i wanted to understand due the nature of the filter object is not something you could enter tab button as like commandlet where it will assist you options of the syntax(i think).

1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

With the Get-Member cmdlet you can see what other properties are available on a returned object.

For example

Get-VM | Get-SnapShot | Get-Member -MemberType Property

Also note that these properties are described in the online PowerCLI Reference.

For the Get-SnapShot cmdlet, it describes these in the Snapshot object, under the Return Type section.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

2 Replies
LucD
Leadership
Leadership
Jump to solution

With the Get-Member cmdlet you can see what other properties are available on a returned object.

For example

Get-VM | Get-SnapShot | Get-Member -MemberType Property

Also note that these properties are described in the online PowerCLI Reference.

For the Get-SnapShot cmdlet, it describes these in the Snapshot object, under the Return Type section.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

afhamsani
Enthusiast
Enthusiast
Jump to solution

Thank you LucD for your explanations!

0 Kudos