650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M00/8C/23/wKioL1hjbuyy5SP3AABl_f85foI625.png-wh_500x0-wm_3 -wmp_4-s_2406915884.png "title=" Qq20161228155048.png "alt=" Wkiol1hjbuyy5sp3aabl_f85foi625.png-wh_50 "/>
add-pssnapin *vmware* $passwd = Read-Host "Input your vcenter password: " -AsSecureStringConnect-VIServer -Server 10.10.10.10 -User [email protected] -password $passwd $vms = Import-CSV E:\NewVMs.csv foreach ( $VM in $vms) { $Template = get-template $ vm.template $VMHost = Get-VMHost $VM. host $Datastore = Get-Datastore $VM .datastore $OSCustomization = Get-OSCustomizationSpec $VM .customization $ResourcePool = Get-ResourcePool $VM. resourcepool new-vm -name $VM. Name -oscustomizationspec $OSCustomization -Template $Template -VMHost $VMHost -resourcepool $ResourcePool -Datastore $Datastore -RunAsync }
POWERCLI batch creation of virtual machines