Friday, March 19, 2010

Powershell - Get Snapshots for all VMs in a Resource Pool

Recently needed to find all the snapshots in a resource pool, so to do that, I needed to first get all the VMs in the resource pool like this:

Get-VM -Location (Get-ResourcePool mypoolname)

And get the snapshots, so pipe the output and voila:

$snaplist = Get-VM -Location (Get-ResourcePool mypoolname) | Get-Snapshot

Nice and easy!

No comments:

Post a Comment