Reply to Message

View discussion in a popup

Replying to:
LucD
Leadership
Leadership

The object returned by Get-Snapshot contains a property named VM, under which you find the same object that is returned by Get-VM.
So you could do

Get-VM | Get-Snapshot |
    where {$_.VM.powerstate -eq "PoweredOn" -and $_.Created -lt (Get-Date).AddDays(-5)} |
    select vm,name,powerstate


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

Reply
0 Kudos