How to select VMsnapshot?

Nov 22, 2009 at 6:25 PM

Hi all,

this module is awesome and is exactly what I need to automate some stuff, but...

I'm unable to find out how to start demand VM snapshot by script, I know there is "Select-VMSnapshot" command but this need input from user, is there any option to give name of appropriate VM snapshot as parameter to some command?

If yes, please show me example because I'm quite new in powershell so it will be very helpful for me.

Looking forward for your answer.

Thanks a lot.

Coordinator
Nov 24, 2009 at 2:13 PM

get-vmSnapshot  takes -vm and -name parameters so if you know the name of the snapshot you can use that, if you don't know the name you can use -newest to roll back to the most recent snapshot.

 

you can also do

get-vmsnapshot "my vm name"  -newest | restore-vmsnapshot

 

Nov 24, 2009 at 4:34 PM

Yeah that's exactly what I was looking for, unfortunately I didn't saw it at first time that get-vmsnapshot has -name parameter, my fault.

But anyway thanks a lot.