connect-viserver vcenter01 -user administrator@vsphere.local -password VMware1!

Write-host "No of VMs to deploy"

$noofvms=Read-host

write-host "Enter the naming convention"

$vmaname=read-host

for($count=0;$count -le ($noofvms-1);$noofvms++)

{

new-vm -name ($vmname+$count) -vmhost (get-cluster cluser01|get-vmhost|get-random) -disksizemb 100 -portgroup vlan100

}