Hyperv - vswitch Rename vnics

Retrieve list of network adapters for VM test:

Get-VMNetworkAdapter -VMName test

Store each adapter in an array:

$VMNetAdap = Get-VMNetworkAdapter -VMName test

Rename guest network adapters based on array position:

rename-VMNetworkAdapter -VMNetworkAdapter $VMNetAdap[0] -newname P_STAFF
rename-VMNetworkAdapter -VMNetworkAdapter $VMNetAdap[1] -newname P_MISC

Configure trunk details for each guest network adapter:

Set-VMNetworkAdapterVlan -Trunk -AllowedVlanIdList "1" -VMName "test" -VMNetworkAdapterName "P_STAFF" -NativeVlanId 0
SSet-VMNetworkAdapterVlan -Trunk -AllowedVlanIdList "10,11,12,13,14" -VMName "test" -VMNetworkAdapterName "P_MISC" -NativeVlanId 0