Add-VMSwitch

Adds a virtual switch to an Ethernet resource pool.

Syntax

Add-VMSwitch
   [-Name] <String[]>
   [-ResourcePoolName] <String[]>
   [-ComputerName <String[]>]
Add-VMSwitch
   [-VMSwitch] <VMSwitch[]>
   [-ResourcePoolName] <String[]>

Description

The Add-VMSwitch cmdlet adds a virtual switch to an Ethernet resource pool.

Examples

Example 1

PS C:\>Add-VMSwitch -Name Test -ResourcePoolName "Engineering Department"

Adds virtual switch Test to Ethernet resource pool Engineering Department.

Example 2

PS C:\>Get-VMSwitch -Name Test | Add-VMSwitch -ResourcePoolName "Engineering Department"

Adds virtual switch Test to Ethernet resource pool Engineering Department.

Required Parameters

-Name

Specifies the name of the virtual switch to be added.

Type:String[]
Position:1
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:True
-ResourcePoolName

Specifies the name of the resource pool to which the virtual switch is to be added.

Type:String[]
Position:2
Default value:None
Accept pipeline input:False
Accept wildcard characters:True
-VMSwitch

Specifies the virtual switch to be added to the Ethernet resource pool.

Type:VMSwitch[]
Position:1
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False

Optional Parameters

-ComputerName
Type:String[]
Position:Named
Default value:.
Accept pipeline input:False
Accept wildcard characters:False

Outputs

None by default; Microsoft.Virtualization.Powershell.VMNetwork if -PassThru is present.