This is the built-in help made by Microsoft for the command 'Get-NetworkSwitchFeature', 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 features of a network switch.
Get-NetworkSwitchFeature [-InformationAction {SilentlyContinue | Stop | Continue | Inquire | Ignore | Suspend}] [-InformationVariable [<System.String>]] [-Name [<String>]]
-CimSession <CimSession> [<CommonParameters>]
Get-NetworkSwitchFeature [-InformationAction {SilentlyContinue | Stop | Continue | Inquire | Ignore | Suspend}] [-InformationVariable [<System.String>]] -CimSession
<CimSession> -Enabled [<CommonParameters>]
Get-NetworkSwitchFeature [-InformationAction {SilentlyContinue | Stop | Continue | Inquire | Ignore | Suspend}] [-InformationVariable [<System.String>]] -CimSession
<CimSession> -Disabled [<CommonParameters>]
The Get-NetworkSwitchFeature cmdlet gets features of a network switch.
<
Disable-NetworkSwitchFeature
Enable-NetworkSwitchFeature
<
Example 1: Get all features
PS C:\>$Session = New-CimSession -ComputerName "NetworkSwitch08"
PS C:\> Get-NetworkSwitchFeature -CimSession $Session
Name IsEnabled InstanceID PSComputerName
---- --------- ---------- --------------
SSH True Contoso:Feature:2 10.19.26.49
Tacacs True Contoso:Feature:3 10.19.26.49
BGP False Contoso:Feature:4 10.19.26.49
VLAN True Contoso:Feature:5 10.19.26.49
LACP True Contoso:Feature:6 10.19.26.49
DHCP False Contoso:Feature:7 10.19.26.49
LLDP True Contoso:Feature:8 10.19.26.49
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 features for the switch NetworkSwitch08 by using the $Session object. This example shows representative results.
Example 2: Get all enabled features
PS C:\>Get-NetworkSwitchFeature -CimSession $Session -Enabled
This command gets all the enabled features on a network switch. The command includes a CimSession, similar to the first example.
Example 3: Get all disabled features
PS C:\>Get-NetworkSwitchFeature -CimSession $Session -Disabled
This command gets all the disabled features on a network switch. The command includes a CimSession, similar to the first example.
Example 4: Get features by using a name
PS C:\>Get-NetworkSwitchFeature -CimSession $Session -FeatureName "*BGP*"
This command gets all features that contain the string BGP on a network switch. The command includes a CimSession, similar to the first example.