Export (0) Print
Expand All
Expand Minimize

Add-VMSwitch

Windows Server 2012 R2 and Windows 8.1

Updated: June 10, 2014

Applies To: Windows 8.1, Windows PowerShell 4.0, Windows Server 2012 R2

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[]>

Specifies an array of Hyper-V hosts. The cmdlet adds the virtual switch on the Hyper-V hosts that you specify.


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.

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.HyperV.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"

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft