Last Update: September 2, 2012
PowerShell Version: 3.0
| Class | Library |
| Instructor Use | PSv3.psm1 |
.SYNOPSIS
Reverts VMs based in a name pattern and state.
.DESCRIPTION
Selectively reverts virtual machines whose names match a pattern
and operational state. By default, all VHD files attached to the
VMS will be detached prior to reverting to help preserve
data.
.PARAMETER VMName
The pattern to search for in the VM name. This is a wildcard search.
.PARAMETER SnapShot
The name of the snapshot to revert to. The default is "StartingImage".
.PARAMETER RunningVMs
Reverts running VMS that match the name pattern.
.PARAMETER StoppedVMs
Reverts stopped VMS that match the name pattern.
.PARAMETER AllVMs
Reverts all VMS that match the name pattern.
.PARAMETER RemoveSCSIDrives
Removes the attached VHD files on the SCSI controllers
prior to reverting the VM. This helps to protect data
on those VHDs. The default setting is True.
.EXAMPLE
Restore-ClassVM -VMNanme "20417" -RunningVMs
Reverts all virtual machines whose name contains "20417" and
is in a "Running" state.
.EXAMPLE
Restore-ClassVM -VMNanme "20417" -StoppedVMs -RemoveSCSIDrives $false
Reverts all virtual machines whose name contains "20417" and
is in a "Stopped" state. This cmdlet will also not remove the VHD files
on the SCSI controllers resulting in possible loss of data on those drives.
.NOTES
This cmdlet will only function correctly if the current session is
run under elevated credentails.
.COMPONENT
Hyper-V
No comments:
Post a Comment