Add-VMSwitch

Add-VMSwitch

Adds a virtual switch to an Ethernet resource pool.

Syntax

Parameter Set: NetworkByName
Add-VMSwitch [-Name] <String[]> [-ResourcePoolName] <String[]> [-ComputerName <String[]> ] [ <CommonParameters>]

Parameter Set: NetworkByObject
Add-VMSwitch [-VMSwitch] <VMSwitch[]> [-ResourcePoolName] <String[]> [ <CommonParameters>]

Detailed Description

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

Parameters

-ComputerName<String[]>

Aliases

none

Required?

false

Position?

named

Default Value

.

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Name<String[]>

Specifies the name of the virtual switch to be added.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

true

-ResourcePoolName<String[]>

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

Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

true

-VMSwitch<VMSwitch[]>

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

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

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

Examples

Example 1

Adds virtual switch Test to Ethernet resource pool Engineering Department.

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

Example 2

Adds virtual switch Test to Ethernet resource pool Engineering Department.

PS C:\> Get-VMSwitch –Name Test | Add-VMSwitch –ResourcePoolName “Engineering Department”