Clone a VM from a Snapshot using PowerCLI
- PowerShell 100%
| README.md | ||
| VMwareCloneVMFromSnapshot.ps1 | ||
Clone a VM from a Snapshot using PowerCLI
.SYNOPSIS
Function to create a clone from a snapshot of a VM.
.DESCRIPTION
Function to create a clone from a snapshot of a VM.
.PARAMETER SourceVM
VM to clone from.
.PARAMETER CloneName
Name of the clone to create
.PARAMETER SnapshotName
Name of the snapshot to clone from
.PARAMETER CurrentSnapshot
Use the current snapshot instead of a named snapshot
.PARAMETER Cluster
Name of the cluster to place the clone in
.PARAMETER Datastore
Name of the datastore to place the clone in
.PARAMETER VMFolder
Name of the Virtual Machine folder to put the VM in
.PARAMETER LinkedClone
Create a linked clone from the snapshot, rather than a full clone
.INPUTS
String.
System.Management.Automation.PSObject.
.OUTPUTS
VMware.Vim.ManagedObjectReference.
.EXAMPLE
PS> New-VMFromSnapshot -SourceVM VM01 -CloneName "Clone01" -Cluster "Test Cluster" -Datastore "Datastore01"
.EXAMPLE
PS> New-VMFromSnapshot -SourceVM VM01 -CloneName "Clone01" -SnapshotName "Testing" -Cluster "Test Cluster" -Datastore "Datastore01" -VMFolder "Test Clones" -LinkedClone