Apply-VMSnapshot

Dec 13, 2008 at 11:53 AM
If I have the VMName and the Snapshoot name, how could I use this function/filter to apply said snapshot to said VM?

I tried, Apply-VMSnapshot "VMName", "SnapshotName" with no result.
I looked into the library and noticed that there is only a Filter not a function and it seems to have the following signature: $SnapShot, [Switch]$force , [Switch]$Restart, [Switch]$wait

I tried: Get-VM "<vmname>" | Apply-VMSnapshot "<Snapshotname>"

and nothing :(

Is this even possible with this library?

Thanks.
Coordinator
Jan 10, 2009 at 11:17 PM
As you say the signature is $SnapShot, [Switch]$force , [Switch]$Restart, [Switch]$wait

You need to pass it a snapshot, NOT a VM.
Have you tried the example  that is embedded in the script

choose-vmsnapshot "vmname"  | Apply-vmsnapshot  ?
 

I may add the option to get a snapshot from the VM aname and Snapshot name for the next release