New-VirtualPortGroup

This cmdlet creates a new port group on the host using the provided parameters.

Syntax

[-VirtualSwitch]  <VirtualSwitch>
-Name  <String>
[-Server  <VIServer[]>]
[-VLanId  <Int32>]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
VirtualSwitch
VirtualSwitch 1
  • wildcards
  • pipeline
  • Specifies the virtual switch for which you want to create a new port group.
    required
    Name
    String named Specifies a name for the new port group.
    optional
    Server
    VIServer[] named
  • wildcards
  • Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is provided or $null value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.
    optional
    VLanId
    Int32 named Specifies the VLAN ID for ports using this port group. The following values are valid:

    Output

    VMware.VimAutomation.ViCore.Types.V1.Host.Networking.VirtualPortGroup

    Examples


    Example 1

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

    Feedback

    Was this page helpful?