Syntax
Get-VDSwitch -Id <String[]> [-Server <VIServer[]>] [<CommonParameters>]Related Commands
Online VersionDetailed Description
This cmdlet retrieves vSphere distributed switches.Parameters
Name | Type | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
Name | String[] | Specifies the names of the vSphere distributed switches that you want to retrieve. | false | False | |
Id | String[] | 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. | true | False | |
Location | FolderContainer[] | Specifies vCenter Server container objects that you want to search for vSphere distributed switches. This parameter accepts Datacenter and Folder objects. | false | True (ByValue) | |
RelatedObject | VDSwitchRelatedObjectBase[] | Specifies an object to retrieve one or more vSphere distributed switches that are related to the object. This parameter accepts NetworkPool and OMResource objects. | true | True (ByValue) | |
Server | VIServer[] | 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. | false | False | |
Tag | Tag[] | Returns only the vSphere distributed switches that are associated with any of the specified tags. | false | False | |
VM | VirtualMachine[] | Specifies virtual machines to retrieve vSphere distributed switches they are connected to. | false | True (ByValue) | |
VMHost | VMHost[] | Specifies hosts to retrieve vSphere distributed switches to which the hosts are added. | false | True (ByValue) |
Return Type
Zero or more VDSwitch objectsNotes
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.