Server 2012 Powershell module for Hyper-V how to create multiple vms

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

}

 

 

 

 

 

One thought on “Server 2012 Powershell module for Hyper-V how to create multiple vms”

  1. Hey I am a fan of your posts and I just want to point you to my blog and a couple of powershell scripts

    I have created them from a hodge podge of sites and just trial and error, not a programmer just old school administrator

    http://stephanco.blogspot.com/2013/05/detailed-report-of-your-hyper-v-server.html

    http://stephanco.blogspot.com/2013/05/new-vm-powershell-commandlet-to-easily.html

    I was hoping you could improve them or post them for others to use, my blog is not all that popular but I want to share.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.