PowerCLI Reference

Get-VDSwitch

Synopsis

This cmdlet retrieves vSphere distributed switches.

Syntax

Get-VDSwitch [[-Name] <String[]>] [-Location <FolderContainer[]>] [-VMHost <VMHost[]>] [-VM <VirtualMachine[]>] [-Tag <Tag[]>] [-Server <VIServer[]>] [<CommonParameters>]

Get-VDSwitch -Id <String[]> [-Server <VIServer[]>] [<CommonParameters>]

Get-VDSwitch -RelatedObject <VDSwitchRelatedObjectBase[]> [<CommonParameters>]

Related Commands

Online version
Remove-VDSwitch
New-VDSwitch
Set-VDSwitch
Export-VDSwitch

Detailed Description

This cmdlet retrieves vSphere distributed switches.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
NameString[]Specifies the names of the vSphere distributed switches that you want to retrieve.falsefalse
IdString[]Specifies the IDs of the vSphere distributed switches that you want to retrieve.

Note: When a list of values is specified for the Id parameter, the returned objects would have an ID that matches exactly one of the string values in that list.
truefalse
LocationFolderContainer[]Specifies vCenter Server container objects that you want to search for vSphere distributed switches. This parameter accepts Datacenter and Folder objects.falsetrue (ByValue)
RelatedObjectVDSwitchRelatedObjectBase[]Specifies an object to retrieve one or more vSphere distributed switches that are related to the object. This parameter accepts NetworkPool and OMResource objects.truetrue (ByValue)
ServerVIServer[]Specify the cloud servers 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-CIServer.falsefalse
TagTag[]Returns only the vSphere distributed switches that are associated with any of the specified tags.falsefalse
VMVirtualMachine[]Specifies virtual machines to retrieve vSphere distributed switches they are connected to.falsetrue (ByValue)
VMHostVMHost[]Specifies hosts to retrieve vSphere distributed switches to which the hosts are added.falsetrue (ByValue)

Return Type

Zero or more VDSwitch objects

Notes

Examples

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

Get-Datacenter -Name MyDatacenter | Get-VDSwitch

Retrieves all vSphere distributed switches in the specified datacenter.

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

Get-VMHost -Name MyVMHost | Get-VDSwitch

Retrieves all vSphere distributed switches to which the specified host is added.

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

Get-VM -Name MyVM | Get-VDSwitch

Retrieves all vSphere distributed switches to which the specified virtual machine is connected.


Copyright © VMware, Inc. All rights reserved.