How to restore Hyper-V Snap shot using Poweshell without prompt out to ask for confirm

 

Below are the example on how to restore Hyper-V Snapshot by using Powershell command.

PS command line :-

Restore-VMSnapshot –Name (name for the snapshot) –VMName (name for the VM) -confirm:$false

(if you apply –confirm:$false its means will not prompt out and automatically execute.)

image

PS command line :-

Restore-VMSnapshot –Name (name for the snapshot) –VMName (name for the VM) –confirm

(if you apply just a –confirm its means will prompt out for you to choose whether want to revert snap shot or not )

image

you can save it to *. PS1 after copy and paste to notepad.

Post a Comment

0 Comments