-TotalCount
flag can be used with all the parameter combinations
To list all the cmdlets, functions and aliases available in the current session and imported from the remote sessions as well.
Get-Command
To list applications and external scripts along with the cmdlets, functions and aliases.
Get-Command *
To list all the commands from current session only
Get-Command -ListImported
To limit the output count
Get-Command -TotalCount 10
To list all the commands in the module Microsoft.PowerShell.Core
Get-Command -Module Microsoft.PowerShell.Core
To list all the commands of a specific type (CmdLet/Function/Alias/ExternalScript/Application)
Get-Command -CommandType CmdLet
To list all the applications (executable files) available the paths of PATH environment variable
Get-Command -CommandType Application
Gets the command by its name
Get-Command -Name Get-ComputerInfo
Gets the commands by name matching with the given wildcard pattern
Get-Command -Name *ipaddress*
To list the commands with a specific verb
Get-Command -Verb Invoke
To list the commands with a specific noun
Get-Command -Noun Computer
To list the command with a specific verb and noun combination
Get-Command -Verb Get -Noun Host
To list the commands with a specific verb matching with the wildcard
# Gets both Get and Set commands
Get-Command -Verb *et
To list the commands with a specific noun matching with the wildcard
Get-Command -Noun *Info
To list the command with a specific verb and noun combination using the wildcard pattern
Get-Command -Verb *et -Noun Host
Get-Command dir
Get the commands by either the parameter name or parameter type, or both.
Get-Command -ParameterName VMName
Get-Command -ParameterType System.Boolean
Get-Command -ParameterName Scoped -ParameterType System.Boolean
You can use this switch if you are not sure about exact name of the command, and you can’t use this with wildcard search, and works only with -Name parameter combination
Get-Command -Name gotcemmand -UseFuzzyMatching
To test this, create an empty Write-Error function and then run the command below
To create an empty function: Function Write-Error {}
Get-Command -Name Write-Error -All
# or
Get-Command -Name notepad -All
To list the commands from the specific version of the module
Get-Command -FullyQualifiedModule @{ModuleName = "UEV"; ModuleVersion = "2.1.639.0" }
Gets the commands count
Get-Command | Measure-Object -Line | Select-Object -ExpandProperty Lines
Get-Command -ListImported | Measure-Object -Line | Select-Object -ExpandProperty Lines
List all the commands which return output and its output type
Get-Command | Where-Object OutputType | Format-List
To refer the syntax of a command
Get-Command -Name Get-Counter -Syntax
To list all the information related to the given command
Get-Command -Name New-NetIPAddress | Format-List *
Gets the list of parameters
Get-Command -Name Get-ControlPanelItem | Select-Object -ExpandProperty Parameters
# Or
(Get-Command -Name Get-ControlPanelItem).Parameters
Gets the module/source name of a given command
Get-Command -Name Show-ControlPanelItem | Select-Object -ExpandProperty ModuleName
# Or
(Get-Command -Name Show-ControlPanelItem).ModuleName
Gets the function code
Get-Command -Name Get-NetAdapterStatistics | Select-Object -ExpandProperty Definition
# Or
(Get-Command -Name Get-NetAdapterStatistics).Definition
Gets the command output type
Get-Command -Name Get-NetAdapterHardwareInfo | Select-Object -ExpandProperty OutputType
# Or
(Get-Command -Name Get-NetAdapterHardwareInfo).OutputType
To know the default parameterset
Get-Command -Name Get-Disk | Select-Object -ExpandProperty DefaultParameterSet
# Or
(Get-Command -Name Get-Disk).DefaultParameterSet
To know the type of a given command
Get-Command -Name Get-NetRoute | Select-Object -ExpandProperty CommandType
# Or
(Get-Command -Name Get-NetRoute).CommandType
List all the dynamic parameters of a given command
Get-Command -Name Get-Package -ArgumentList 'Cert:' | `
Select-Object -ExpandProperty ParameterSets | `
ForEach-Object {$_.Parameters} | `
Where-Object {$_.IsDynamic} | `
Select-Object -Property Name -Unique