description | external help file | Module Name | ms.date | online version | schema | title |
---|---|---|---|---|---|---|
Use this topic to help manage Windows and Windows Server technologies with Windows PowerShell. |
Get-VMNetworkAdapterPortId.psm1-help.xml |
HNVDiagnostics |
12/20/2016 |
2.0.0 |
Get-VMNetworkAdapterPortId |
Gets the VFP/VSwitch port ID.
Get-VMNetworkAdapterPortId [[-VMName] <String>] [[-VMNetworkAdapterName] <String>] [<CommonParameters>]
The Get-VMNetworkAdapterPortId cmdlet gets the VFP/VSwitch port ID for a virtual machine or infrastructure port. This cmdlet also returns the friendly name of the virtual switch to which the port is attached and the port name.
PS C:\> ($switchName, $portId, $portName) = Get-VMNetworkAdapterPortId -VMName "vm1" -VMNetworkAdapterName "VMAdapter"
PS C:\> ($switchName, $portId, $portName) = Get-VMNetworkAdapterPortId -VMNetworkAdapterName "HostAdapter"
This command gets the port ID for an infrastructure port, and then saves it to the specified variables.
Specifies the name of the virtual machine for which to retrieve the port ID.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the name of the virtual machine network adapter for which to retrieve the port ID.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.