Example 1: This command will get all the PowerShell Cmdlets, functions, and aliases that are installed on the computer.
Example 2: This command will get the commands by type. Like cmdlets, aliases, functions.
Get-command –type cmdlets
Example 3: This command will Count all the Commands.
Get-Command | measure
Example 4: This commands will count the commands only by type.
Get-command –type cmdlets | measure
Get-command –type function | measure
Get-command –type aliases | measure
Example 5: This command will get all commands of all types on the local computer, including executable files in the paths of the Path environment variable.
Example 6: This command will show how to use the Get-Command cmdlet with an alias. Although it is typically used on cmdlets and functions, Get-Command also gets scripts, functions, aliases, workflows, and executable files.
Example 7: This command gets information about the Get-AppLockerPolicy cmdlet. It also imports the AppLocker module, which adds all of the commands in the AppLocker module to the current session.
Example 8: This command uses the ListImported parameter to get only the commands in the current session.
Example 9: This command gets all of the cmdlets, sorts them alphabetically by the noun in the cmdlet name, and then displays them in noun-based groups. This display can help you find the cmdlets for a task.
Get-Command -Type Cmdlet | Sort-Object -Property Noun | Format-Table -GroupBy Noun
Example 10: This command uses the Module parameter to get the commands in the Microsoft.PowerShell.Security and PSScheduledJob modules.
Get-Command -Module Microsoft.PowerShell.Security, PSScheduledJob
Example 11: This command uses the ArgumentList and Syntax parameters to get the syntax of the Get-ChildItem cmdlet when it is used in the Cert: drive. The Cert: drive is a Windows PowerShell drive that the Certificate Provider adds to the session.
Get-Command Get-Childitem -Args Cert: -Syntax
Example 12: This command gets cmdlets that have a parameter whose name includes Auth and whose type is AuthenticationMechanism . You can use a command like this one to find cmdlets that let you specify the method that is used to authenticate the user.
Get-Command -ParameterName *Auth* -ParameterType AuthenticationMechanism
Example 13: This command gets the cmdlets and functions that have an output type and the type of objects that they return.
Get-Command -Type Cmdlet | Where-Object OutputType | Format-List -Property Name, OutputType