Difference between revisions of "Useful One-Liners (PowerCLI)"

Jump to navigation Jump to search
m
(→‎Virtual Machine: Re-orged and added mass snapshot start-stops)
Line 61: Line 61:


==== Start Snapshot on Multiple VMs ====
==== Start Snapshot on Multiple VMs ====
Assumes you've already got an array object of VMs containing the VM's you want to snapshot (eg <code>$VMs = Get-VM -Location (Get-Folder -Name "MyFolder")</code> for VM's in a particular folder, see [[#Get_list_of_VM.27s|Get_list_of_VM.27s]] for further info)
Assumes you've already got an array object of VMs containing the VM's you want to snapshot (eg <code>$VMs = Get-VM -Location (Get-Folder -Name "MyFolder")</code> for VM's in a particular folder, see [[#Get_list_of_VM.27s|Get_list_of_VM's]] for further info)
<source lang="powershell">New-Snapshot -Name "Pre change XYZ snapshot" -Description "Requested by TJ Hooker" -Memory -Quiesce -VM $vms </source>
<source lang="powershell">New-Snapshot -Name "Pre change XYZ snapshot" -Description "Requested by TJ Hooker" -Memory -Quiesce -VM $vms </source>


Navigation menu