powershellscripts.com

Tutorials  PowerShell Cmdlet Help for Get-VirtualPortGroup



NAME
Get-VirtualPortGroup

SYNOPSIS
Retrieves the available port groups of hosts, virtual machines, and virtual switches.

SYNTAX
Get-VirtualPortGroup [-Id ] [[-VMHost] ] [-VM ] [-VirtualSwitch hBase[]>] [-Name ] [-Datacenter ] [-Standard] [-Distributed] [-Server ] [ nParameters>]


DESCRIPTION
Retrieves the available port groups of hosts, virtual machines, and virtual switches. To specify a server different
from the default one, use the -Server parameter.


PARAMETERS
-Id
Specify the Ids of the port groups you want to retrieve.

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

-VMHost
Specify the hosts whose port groups you want to retrieve. The position of this parameter is deprecated and will
be changed in a future release. To avoid errors when you run existing scripts on future PowerCLI versions, spe
cify the parameter by name.

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

-VM
Specify the virtual machines whose port groups you want to retrieve.

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

-VirtualSwitch
Specify the virtual switches for which you want to retrieve their port groups.

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

-Name
Specify the names of the port groups you want to retrieve.

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

-Datacenter
Filter the port groups of the virtual switches connected to hosts in the specified datacenters.

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

-Standard
Indicate that you want to retrieve the port groups for VirtualSwitch objects.

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

-Distributed
Indicate that you want to retrieve the port groups for DistributedSwitch objects.

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


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

New-VirtualPortGroup -VirtualSwitch $vswitch -Name PortGroup

Get-VirtualPortGroup -VirtualSwitch $vswitch


Creates a virtual switch named VSwitch on the host with IP address 10.23.112.123. Creates a new virtual ports group
named PortGroup for the new switch. Retrieves the virtual ports groups of VSwitch.






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