PowerCLI Reference

Get-VDPort

Synopsis

This cmdlet retrieves virtual distributed ports.

Syntax

Get-VDPort [-VDPortgroup <VDPortgroup[]>] [-VDSwitch <VDSwitch[]>] [[-Key] <String[]>] [-ActiveOnly] [-ConnectedOnly] [-Uplink] [-Server <VIServer[]>] [<CommonParameters>]

Related Commands

Online version
Set-VDPort

Detailed Description

This cmdlet retrieves virtual distributed ports. At least one of the VDSwitch or VDPortgroup parameters must be specified.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
KeyString[]Specifies the key of the port which you want to retrieve.falsefalse
ActiveOnlySwitchParameterIf set, only the active ports are returned.falsefalse
ConnectedOnlySwitchParameterIf set, only the connected ports are returned.falsefalse
ServerVIServer[]Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is given to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.falsefalse
UplinkSwitchParameterIf set, only uplink ports are returned. If not set, both uplink and non-uplink ports are returned. This parameter, like every SwitchParameter, can also be set to false (-Uplink:$false), in which case only non-uplink ports are returned.falsefalse
VDPortgroupVDPortgroup[]Specifies the distributed virtual port group whose ports you want to retrieve.falsetrue (ByValue)
VDSwitchVDSwitch[]Specifies the vSphere distributed switch whose ports you want to retrieve.falsetrue (ByValue)

Return Type

Zero or more VDPort objects

Notes

Requires vSphere API 4.0 or later.

Examples

-------------- Example 1 --------------

Get-VDPortGroup "MyVDPortgroup" | Get-VDPort -Key "MyPortgroupKey"

Retrieves a virtual distributed port assigned with a key named "MyPortgroupKey" from a virtual distributed port group named "MyVDPortgroup".

-------------- Example 2 --------------

Get-VDSwitch "MyVDSwitch" | Get-VDPort -Uplink

Retrieves all uplink virtual distributed ports of a vSphere distributed switch named "MyVDSwitch".

-------------- Example 3 --------------

Get-VDSwitch "MyVDSwitch" | Get-VDPort -ConnectedOnly

Retrieves all connected virtual distributed ports of a vSphere distributed switch named "MyVDSwitch".


Copyright © VMware, Inc. All rights reserved.