Adding a Port Group and Setting the VLAN tag from the Service Console in ESX

Use the following:

esxcfg-vswitch -A "Port Group Name" vSwitch2 && esxcfg-vswitch -v N -p "Port Group Name" vSwitch2

Where N is the VLAN tag.