powershellscripts.com

Tutorials  PowerShell Cmdlet Help for New-VirtualPortGroup



NAME
New-VirtualPortGroup

SYNOPSIS
Creates a new port group on the specified host.

SYNTAX
New-VirtualPortGroup [-Name] [-VirtualSwitch] [-VLanId ] [-Server ] [-W
hatIf] [-Confirm] []


DESCRIPTION
Creates a new port group on the host using the provided parameters.


PARAMETERS
-Name
Specify a name for the new port group.

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

-VirtualSwitch
Specify the virtual switch for which you want to create a new port group.

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

-VLanId
Specify the VLAN ID for ports using this port group. The following values are valid:

0 - specifies that you do not want the port group associated with a VLAN.
1 to 4094 - specifies a VLAN ID for the port group.
4095 - specifies that the port group should use trunk mode, which allows the guest operating system to manage i
ts own VLAN tags.

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

-WhatIf
Indicate that the cmdlet is run only to display the changes that would be made and actually no objects are modi
fied.

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

-Confirm
If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false,
the cmdlet runs without asking for user confirmation.

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


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
VirtualPortGroup


NOTES




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

C:\PS>$vswitch = New-VirtualSwitch -VMHost 10.23.114.234 -Name VSwitch

$vportgroup = New-VirtualPortGroup -VirtualSwitch $vswitch -Name VPortGroup


Creates a virtual port group named VPortGroup on the virtual switch VSwitch.






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