## Tool to automate VM creation $VMName = "SRV-01" cp D:\VHD\Base_dif\Base_server_g2.vhdx D:\VHD\$VMName.vhdx Mount-VHD d:\VHD\$VMName.vhdx Copy-Item d:\Unattend\$VMName.xml -Destination e:\Windows\Panther\Unattend.xml Dismount-VHD d:\VHD\$VMName.vhdx $vms = @{ Name = $VMName Generation = '2' MemoryStartupBytes = 1024Mb VHDPath = "d:\VHD\$VMName.vhdx" SwitchName = 'Arc-SRV' } New-VM @vms Set-VMMemory $VMName -DynamicMemoryEnabled $true -MinimumBytes 512MB -StartupBytes 1024MB -MaximumBytes 2GB $VMName = "RTR-01" cp D:\VHD\Base_dif\Base_server_g2.vhdx D:\VHD\$VMName.vhdx Mount-VHD d:\VHD\$VMName.vhdx Copy-Item d:\Unattend\$VMName.xml -Destination e:\Windows\Panther\Unattend.xml Dismount-VHD d:\VHD\$VMName.vhdx $vms = @{ Name = $VMName Generation = '2' MemoryStartupBytes = 1024Mb VHDPath = "d:\VHD\$VMName.vhdx" SwitchName = 'Arc-Cli' } New-VM @vms Set-VMMemory $VMName -DynamicMemoryEnabled $true -MinimumBytes 512MB -StartupBytes 1024MB -MaximumBytes 2GB Add-VMSwitch -Name "Arc-SRV" -ResourcePoolName "Arc-SRV" Add-VMSwitch -Name "WAN" -ResourcePoolName "WAN" $VMName = "RTR-02" cp D:\VHD\Base_dif\Base_server_g2.vhdx D:\VHD\$VMName.vhdx Mount-VHD d:\VHD\$VMName.vhdx Copy-Item d:\Unattend\$VMName.xml -Destination e:\Windows\Panther\Unattend.xml Dismount-VHD d:\VHD\$VMName.vhdx $vms = @{ Name = $VMName Generation = '2' MemoryStartupBytes = 1024Mb VHDPath = "d:\VHD\$VMName.vhdx" SwitchName = 'Bou-LAN' } New-VM @vms Set-VMMemory $VMName -DynamicMemoryEnabled $true -MinimumBytes 512MB -StartupBytes 1024MB -MaximumBytes 2GB Add-VMSwitch -Name "WAN" -ResourcePoolName "WAN" $VMName = "RTR-03" cp D:\VHD\Base_dif\Base_server_g2.vhdx D:\VHD\$VMName.vhdx Mount-VHD d:\VHD\$VMName.vhdx Copy-Item d:\Unattend\$VMName.xml -Destination e:\Windows\Panther\Unattend.xml Dismount-VHD d:\VHD\$VMName.vhdx $vms = @{ Name = $VMName Generation = '2' MemoryStartupBytes = 1024Mb VHDPath = "d:\VHD\$VMName.vhdx" SwitchName = 'WAN' } New-VM @vms Set-VMMemory $VMName -DynamicMemoryEnabled $true -MinimumBytes 512MB -StartupBytes 1024MB -MaximumBytes 2GB Add-VMSwitch -Name "Aston" -ResourcePoolName "Aston"