Using this PowerShell script you can the below mentioned script for create multiple vms from PowerShell module which is coming with hyper-v.I have just create this script for learning purpose and at the movement its not checking current hardware availability of the server/you may can develop this script.(Add the hardware profile,change the path,check the system resource availability).Before running this script you have to set the execution policy(set-executionpolicy )

 

Import-Module hyper-v

$vmname

$no

$no=Read-Host “How many no of vms you want?”

$vmname=Read-Host “Enter the name for one vm,it will continu like thi (vm1,vm2)”

for($i=1;$i -le $no;$i++)

{

$vmnamefull=$vmname+$i -as [string]

new-vm -Name $vmnamefull

}

 

 

 

 

 

Advertisements