VD Port Category
Cmdlets are usually implemented around resource operations. The four basic operations are CREATE, READ, UPDATE and DELETE. This set of operations is known as CRUD. Most of the cmdlets support CRUD which are respectively cmdlets that start with the New/Get/Set/Remove cmdlet verbs but they also may have additional operations
Step 1: Retrieve a object by running a Get command
# Retrieves a virtual distributed port assigned with a key named "MyPortgroupKey" from a virtual distributed port group named "MyVDPortgroup".
Get-VDPortGroup "MyVDPortgroup" | Get-VDPort -Key "MyPortgroupKey"
Step 2 : Run commands from the CRUD group
# Creates a new distributed port group on the specified vSphere distributed switch with the specified number of ports and VLAN ID.
Get-VDSwitch -Name "MyVDSwitch" | New-VDPortgroup -Name "MyVDPortGroup" -NumPorts 8 -VLanId 4
# Exports the configuration of the specified port group to the specified file.
Get-VDPortGroup -Name 'MyVDPortGroup' | Export-VDPortGroup -Destination 'C:\MyVDSwitchesBackup\MyVDPortGroup_21122012.zip'
# Removes the specified distributed port group from the vSphere distributed switch that it belongs to.
Get-VDPortGroup -Name "MyVDPortGroup" | Remove-VDPortGroup
Step 3: Explore More Related Commands:
Get-VDPortgroup | This cmdlet retrieves distributed port groups. |
Get-VDPortgroupOverridePolicy | This cmdlet retrieves the policy for overriding port group settings at port level. |
Set-VDPort | This cmdlet modifies the configuration of virtual distributed ports. |
Set-VDPortgroup | This cmdlet modifies the configuration of distributed port groups. |
Set-VDPortgroupOverridePolicy | This cmdlet modifies the policy for overriding port group settings at port level. |