powershellscripts.com

Tutorials  PowerShell Cmdlet Help for Set-VirtualPortGroup



NAME
Set-VirtualPortGroup

SYNOPSIS
Changes the properties of the specified virtual port group.

SYNTAX
Set-VirtualPortGroup [-Name ] [-VLanId ] [-VirtualPortGroup] [-WhatIf] [-Confir
m] []


DESCRIPTION
Changes the properties of the specified virtual port group.


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

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

-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

-VirtualPortGroup
Specify the virtual port group whose properties you want to change.

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

-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.112.36 -Name VSwitch

$vportgroup1 = New-VirtualPortGroup -VirtualSwitch $vswitch -Name VPortGroup1

$vportgroup2 = Set-VirtualPortGroup -VirtualPortGroup $vportgroup1 -VLanId 1


Creates a new virtual switch named VSwitch on the virtual machine host with IP address 10.23.112.36. Creates a new
virtual port group for the new switch named VPortGroup1. Sets the VLAN ID for the ports using the Ports02_19 group.






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