Quantcast
Viewing all articles
Browse latest Browse all 10

PowerShell Script To Create Snapshot of All VMs – Hyper-V

$VSMgtSvc=Get-WmiObject -ComputerName localhost
-NameSpace "rootvirtualization"
-Class "MsVM_virtualSystemManagementService"
get-wmiobject -computername localhost -Namespace rootVirtualization
-query "Select * from MSVM_Computersystem where Description like
'%Virtual%' " | foreach-object {$VSMgtSvc.psbase.invokeMethod
("CreateVirtualSystemSnapshot",@($_,$Null,$null)) }

Viewing all articles
Browse latest Browse all 10

Trending Articles