Add the ability to use the hyperv provider.

This commit is contained in:
man715
2020-08-25 13:03:34 -07:00
parent 85a5990b2f
commit 53b0ec43a3
11 changed files with 885 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
# See: https://www.thomasmaurer.ch/2016/01/change-hyper-v-vm-switch-of-virtual-machines-using-powershell/
param ([String] $vmname)
# Get-VM $vmname | Get-VMNetworkAdapter | Connect-VMNetworkAdapter -SwitchName "NATSwitch"
if (((Get-VMNetworkAdapter -VMName $vmname).Name).Contains("NATAdapter")){
Write-Host "The NATAdapter already exits"
} else {
Add-VMNetworkAdapter -VMName $vmname -SwitchName "NATSwitch" -Name NATAdapter -DeviceNaming On
}