Hyperv - Vswitch Creating VLAN

First of all create a virtual switch on Hyper-V Manager named “Hypervsw”

Now add the network interfaces as below, you can use any name for it. Remember to tag VLANs accordingly on the switchport connected to the machine:

Add-VMNetworkAdapter -ManagementOS -Name VLAN123_PROD_TAG -SwitchName "Hypervsw"
Add-VMNetworkAdapter -ManagementOS -Name VLAN124_DEV_TAG -SwitchName "Hypervsw"

Associate each network interface created above to their respective VLAN:

Set-VMNetworkAdapterVlan -ManagementOS -Trunk -AllowedVlanIdList "1" -VMNetworkAdapterName "VLAN123_PROD_TAG" -NativeVlanId 123
Set-VMNetworkAdapterVlan -ManagementOS -Trunk -AllowedVlanIdList "1" -VMNetworkAdapterName "VLAN124_DEV_TAG" -NativeVlanId 124

Use the commands below for troubleshooting:

Get-VMNetworkAdapterVlan
Get-VMNetworkAdapter -ManagementOS
Get-VMNetworkAdapter -All