Ok, I have information from Onyx on how to do it in the gui and I think I can reproduce in a script, but what I am unsure of is how to gather the required information to pass
I can't seem to find how to get the property for HostNetworkSystem which would be vswitch0
# ------- AddPortGroup ------- $portgrp = New-Object VMware.Vim.HostPortGroupSpec $portgrp.name = "VMotion" $portgrp.vlanId = 3721 $portgrp.vswitchName = "vSwitch0" $portgrp.policy = New-Object VMware.Vim.HostNetworkPolicy $_this = Get-View -Id 'HostNetworkSystem-networkSystem-371' $_this.AddPortGroup($portgrp) # ------- UpdateVirtualNic ------- $nic = New-Object VMware.Vim.HostVirtualNicSpec $nic.portgroup = "VMotion" $_this = Get-View -Id 'HostNetworkSystem-networkSystem-371' $_this.UpdateVirtualNic("vmk1", $nic)