$Server = Read-Host "Enter the Virtual Machine name : " $SRAM = Read-Host "Enter the size of the Virtual Machine Memory : " $ServerVHD = Read-Host "Enter the size of the Virtual Machine Hard Drive : " $VMLOC = Read-Host "Enter the location of the Virtual Machine file : " $Network1 = Read-Host "Enter the name of the Virtual Machine Network : " # Configure Hyper-V Virtual Network remove-vmswitch $Network1 -force -erroractionsilentlycontinue new-vmprivateswitch $Network1 # Create Virtual Machines MD $VMLoc -erroractionsilentlycontinue new-vm $Server -path $VMLoc new-vhd -vhdpaths $VMLoc\$Server -size $ServerVHD add-vmdisk -vm $Server -controllerid 0 -lun 0 -path $VMLoc\$Server get-vm $Server | add-vmdrive -controllerid 1 -lun 0 -dvd get-vm $Server | set-vmmemory -memory $SRAM get-vm $Server | add-vmnic -virtualswitch $Network1