This is the built-in help made by Microsoft for the command 'Get-NetworkSwitchEthernetPort', in PowerShell version 5 - as retrieved from
Windows version 'Microsoft Windows Server 2012 R2 Standard' PowerShell help files on 2016-06-23.
For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.
Gets port information for a network switch.
Get-NetworkSwitchEthernetPort [-DeviceId [<String>]] [-InformationAction {SilentlyContinue | Stop | Continue | Inquire | Ignore | Suspend}] [-InformationVariable
[<System.String>]] -CimSession <CimSession> [<CommonParameters>]
Get-NetworkSwitchEthernetPort [-InformationAction {SilentlyContinue | Stop | Continue | Inquire | Ignore | Suspend}] [-InformationVariable [<System.String>]] -CimSession
<CimSession> -FullDuplexEnabled [<CommonParameters>]
Get-NetworkSwitchEthernetPort [-InformationAction {SilentlyContinue | Stop | Continue | Inquire | Ignore | Suspend}] [-InformationVariable [<System.String>]] -CimSession
<CimSession> -FullDuplexDisabled [<CommonParameters>]
Get-NetworkSwitchEthernetPort [-InformationAction {SilentlyContinue | Stop | Continue | Inquire | Ignore | Suspend}] [-InformationVariable [<System.String>]] -CimSession
<CimSession> -PortNumber <Int32> [<CommonParameters>]
The Get-NetworkSwitchEthernetPort cmdlet gets port information for a network switch.
<
Disable-NetworkSwitchEthernetPort
Enable-NetworkSwitchEthernetPort
<
Example 1: Get all the ports for a device
PS C:\>$Session = New-CimSession -ComputerName "NetworkSwitch08"
PS C:\> Get-NetworkSwitchEthernetPort -CimSession $Session
The first command creates a CimSession for a network switch, and then stores it in the $Session variable. For more information about CimSession objects, type Get-Help
New-CimSession.
The second command gets the ports for NetworkSwitch08 by using the $Session object.
Example 2: Get a specific port
PS C:\>Get-NetworkSwitchEthernetPort -PortNumber 21 -CimSession $Session
Name PortNumber DeviceID FullDuplex AutoSense PortType MaxDataSize
---- ---------- -------- ---------- --------- -------- -----------
Ethernet17 21 Ethernet17 True False 0 9214
This command gets port 21. The example shows the console output for the command. The command includes a CimSession, similar to the first example.
Example 3: Get a port with a specified ID
PS C:\>Get-NetworkSwitchEthernetPort -DeviceID "Ethernet17" -CimSession $Session
This command gets the port for the device that has the ID Ethernet17. The command includes a CimSession, similar to the first example.