I'm testing with creating vm's and VM settings with powershell to do for some automation.
But i'm not able to acomplish something as simple as setting the correct virtual-switch for the VM :(
new-vm -Name "rr-rds2" -MemoryStartupBytes 45056MB -BootDevice NetworkAdapter -NewVHDPath "D:\hyperv\rr-rds2\Virtual Machines\rr-rds2.vhdx" -Path "D:\hyperv\rr-rds2\Virtual Machines\" -Generation 2 -NewVHDSizeBytes 250GB -SwitchName "VM's - RR"
When i'm removing this switch -SwitchName "VM's - RR" the new virtual machine is created with the network adaptper virtual switch status not connected.
What is the correct way to achieve this when creating the vm after the VM is created?