< Back

Set-VirtualPortGroup

Sun Jan 19, 2020 7:09 pm

NAME Set-VirtualPortGroup



SYNOPSIS

This cmdlet modifies the properties of the specified virtual port group.





SYNTAX

Set-VirtualPortGroup [-VirtualPortGroup] <VirtualPortGroup[]> [-Name <String>] [-VLanId <Int32>] [-Confirm]

[-WhatIf] [<CommonParameters>]





DESCRIPTION

This cmdlet modifies the properties of the specified virtual port group.





PARAMETERS

-Name <String>

Specifies a new name for the virtual port group.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-VirtualPortGroup <VirtualPortGroup[]>

Specifies the virtual port group whose properties you want to change.



Required? true

Position? 1

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-VLanId <Int32>

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



0 - specifies that you do not want to associate the port group 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

its own VLAN tags.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

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



-WhatIf [<SwitchParameter>]

Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are

modified.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

Zero or more modified VirtualPortGroup objects







NOTES









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



$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 VPortGroup1

group.



RELATED LINKS

Online Version: https://code.vmware.com/doc/preview?id= ... Group.html

Get-VirtualPortGroup

New-VirtualPortGroup

Remove-VirtualPortGroup