Posts

Showing posts from October, 2015

Create VM's in Hyper-V using Powershell

Create VM's in Hyper-V using Powershell Hola todos, Today I am gonna talk about a small thing i did in my LAB at home, I got a new windows 2012 server DC installed, created a small Virtual infrastructure using Hyper-V Because i don't like manual work and I believe in the term " Work smart and party hard" I created a small script which will create all my VM's, VHD's and configure them all in a small code. the code is stright forward, I mentioned few comments for those who wants to read them, take a look at the code : #The code start here, #Normally Hyper-V module is already imported in your PS session everytime #you run your PS and Hyper-V server or Hyper-V Managment tools is installed #Reading a text file which contains the server names $R = Get-Content -Path "F:\VMServers.txt" foreach ($rr in $R){ #Creating folders for each Vm # you can create a case or if dstatment here to make sure that this folder #doesn't exixts