VMware get snapshot option

Doodad Boy
Doodad Boy used Ask the Experts™
on
How to specify VMWARE Get-snapshot command to show snapshot more thatn 7 days.

I had used created option where i can see when the snapshot has been created.

But how i may more specific to get the command show for those snapshot more than 7 days
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
VMware Engineer | vExpert 18/19
Distinguished Expert 2018
Commented:
You can try the below variant as below
Change this

$ss = Get-vm | Get-Snapshot

TO

$ss = Get-VM | Get-Snapshot | Where {$_.Created -lt (Get-Date).AddDays(-7)}

The same reference is explained in the below URL https://code.vmware.com/forums/2530/vsphere-powercli#545391 for referenece

Thanks,
Murali
Murali SripadaVMware Engineer | vExpert 18/19
Distinguished Expert 2018

Commented:
You can also use this below foreach ($snap in (Get-VM | Get-Snapshot | Where {$_.Created -lt ((Get-Date).AddDays(-7))}))

This would list the get-vm | get-snapshot | and the created get-date -7 days (7 days older snapshot)

Reference : http://www.virtu-al.net/2009/06/22/powercli-snapreminder/
Doodad BoySupprt

Author

Commented:
how i can add the same to be run in vcenter task manager

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial