Get-VMSwitch
Gets virtual switches from one or more virtual Hyper-V hosts.
Get-VMSwitch
[[-Name] <String>]
[[-ResourcePoolName] <String[]>]
[-ComputerName <String[]>]
[-SwitchType <VMSwitchType[]>]
Get-VMSwitch
[[-Id] <Guid[]>]
[[-ResourcePoolName] <String[]>]
[-ComputerName <String[]>]
[-SwitchType <VMSwitchType[]>]
The Get-VMSwitch gets the virtual switches from a Hyper-V host. If you specify no parameters, this cmdlet returns all virtual switches from the local Hyper-V host.
PS C:\>Get-VMSwitch
Gets all virtual switches from the local Hyper-V host.
PS C:\>Get-VMSwitch -SwitchType External
Gets all virtual switches that connect to the external network.
Specifies one or more Hyper-V hosts from which virtual switches are to be retrieved. NetBIOS names, IP addresses, and fully-qualified domain names are allowable. The default is the local computer - use "localhost" or a dot (".") to specify the local computer explicitly.
Type: | String[] |
Position: | Named |
Default value: | . |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the unique identifier of the virtual switch to be retrieved.
Type: | Guid[] |
Position: | 1 |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies the name of the virtual switch to be retrieved.
Type: | String |
Position: | 1 |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | True |
Specifies the resource pool from which the virtual switches are to be retrieved.
Type: | String[] |
Position: | 2 |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | True |
Specifies the type of the virtual switches to be retrieved. Allowed values are External, Internal, and Private.
Type: | VMSwitchType[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | True |
Microsoft.Virtualization.Powershell.EthernetSwitch