powershellscripts.com

Tutorials  PowerShell Cmdlet Help for Get-VirtualSwitch



NAME
Get-VirtualSwitch

SYNOPSIS
Retrieves the virtual switches associated with a virtual machine host or used by a virtual machine.

SYNTAX
Get-VirtualSwitch [-Id ] [[-VMHost] ] [[-VM] ] [-Datacenter ] [
-Name ] [-Standard] [-Distributed] [-Server ] []


DESCRIPTION
Retrieves the virtual switches associated with a virtual machine host or used by a virtual machine. At least one of
the VMHost and VM parameters must be provided. The VM, VMHost, Name parameters do not accept string values throug
h a pipeline because of collision. To specify a server different from the default one, use the -Server parameter.


PARAMETERS
-Id
Specify the Ids of the virtual switches you want to retrieve.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? true

-VMHost
Specify the hosts whose virtual switches you want to retrieve. The position of this parameter is deprecated and
will be changed in a future release. To avoid errors when you run existing scripts on future PowerCLI versions
, specify the parameter by name.

Required? false
Position? 1
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? true

-VM
Specify the virtual machines whose virtual switches you want to retrieve.

Required? false
Position? 2
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? true

-Datacenter
Filter the virtual switches connected to hosts in the specified datacenters.

Required? false
Position? named
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? true

-Name
Specify the names of the virtual switches you want to retrieve. Passing values to this parameter through a pipe
line is deprecated and will be disabled in a future release. The position of this parameter is deprecated and w
ill be changed in a future release. To avoid errors when you run existing scripts on future PowerCLI versions,
specify the parameter by name.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? true

-Standard
Indicate that you want to retrieve only VirtualSwitch objects.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Distributed
Indicate that you want to retrieve only DistributedSwitch objects.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Server
Specify the vSphere servers on which you want to run the cmdlet. If no value is given to this parameter, the co
mmand runs on the default servers. For more information about default servers, see the description of Connect-V
IServer.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? true


This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".

INPUTS



OUTPUTS
VirtualSwitchBase or DistributedSwitch


NOTES




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

C:\PS>Get-VirtualSwitch -VM VM


Retrieves the virtual switch used by the virtual machine named VM.






RELATED LINKS
Online version: http://www.vmware.com/support/developer/PowerCLI/PowerCLI501/html/Get-VirtualSwitch.html
New-VirtualSwitch
Remove-VirtualSwitch
Set-VirtualSwitch