Useful commands for modifying port groups and VLAN settings on ESXi. Can be used in scripts of course to do additions / removals / changes in bulk.
List vSwitches:
=============================================
List port groups
=============================================
Add port group named “VLAN-900” to vSwitch0
=============================================
Assign VLAN 900 to port group “VLAN-900”
=============================================
Delete port group TEST from vSwitch0
=============================================