Created
November 15, 2013 18:40
-
-
Save evandhoffman/7489416 to your computer and use it in GitHub Desktop.
Powershell script to clone VMs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$template = "qa3-template" | |
$datastore = "NAS1" | |
$vmNamePrefix = "qa3-filler" | |
$vmhost = Get-VMHost -Name "prod-vm202.prod.host.com" | |
$vmpool = "QA3 RP" | |
$location = "Junk Boxes" | |
$taskTab = @{} | |
# Create all the VMs specified in $newVmList | |
for ($i = 2; $i -lt 10; $i++) { | |
$vmname = $($vmNamePrefix + $i); | |
Write-Host $vmname | |
New-VM -Name $vmname -Template $template -VMHost $vmhost -ResourcePool $vmpool -Datastore $datastore -RunAsync | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment