Gets basic information about cmdlets and other elements of Windows PowerShell commands.
The Get-Command cmdlet gets basic information about cmdlets and other elements of Windows PowerShell commands in the session, such as aliases, functions, filters, scripts, and applications.
Get-Command gets its data directly from the code of a cmdlet, function, script, or alias, unlike Get-Help, which gets its information from help topic files.
Without parameters, "Get-Command" gets all of the cmdlets and functions in the current session. "Get-Command *" gets all Windows PowerShell elements and all of the non-Windows-PowerShell files in the Path environment variable ($env:path). It groups the files in the "Application" command type.
You can use the Module parameter of Get-Command to find the commands that were added to the session by adding a Windows PowerShell snap-in or importing a module.
-ArgumentList <Object[]>
Gets information about a cmdlet or function when it is used with the specified parameters ("arguments"). The alias for ArgumentList is Args.
To detect dynamic parameters that are available only when certain other parameters are used, set the value of ArgumentList to the parameters that trigger the dynamic parameters.
To detect the dynamic parameters that a provider adds to a cmdlet, set the value of ArgumentList to a path in the provider drive, such as "WSMan:", "HKLM:" or "Cert:". When the command is a Windows PowerShell core provider cmdlet, enter only one path in each command; the provider cmdlets return only the dynamic parameters for the first path the value of ArgumentList. For information about the provider cmdlets, see about_Providers.
|
Required?
|
false
|
|
Position?
|
2
|
|
Default Value
|
|
|
Accept Pipeline Input?
|
false
|
|
Accept Wildcard Characters?
|
false
|
-CommandType <CommandTypes>
Gets only the specified types of commands. Use "CommandType" or its alias, "Type". By default, Get-Command gets cmdlets and functions.
Valid values are:
-- Alias: All Windows PowerShell aliases in the current session.
-- All: All command types. It is the equivalent of "get-command *".
-- Application: All non-Windows-PowerShell files in paths listed in the Path environment variable ($env:path), including .txt, .exe, and .dll files.
-- Cmdlet: The cmdlets in the current session. "Cmdlet" is the default.
-- ExternalScript: All .ps1 files in the paths listed in the Path environment variable ($env:path).
-- Filter and Function: All Windows PowerShell functions.
-- Script: Script blocks in the current session.The following values are permitted for this object type.
-
Alias
-
Function
-
Filter
-
Cmdlet
-
ExternalScript
-
Application
-
Script
-
All
|
Required?
|
false
|
|
Position?
|
named
|
|
Default Value
|
|
|
Accept Pipeline Input?
|
true (ByPropertyName)
|
|
Accept Wildcard Characters?
|
false
|
-Module <string[]>
Gets the commands that came from the specified modules or snap-ins. Enter the names of modules or snap-ins, or enter snap-in or module objects.
You can refer to this parameter by its name, Module, or by its alias, PSSnapin. The parameter name that you choose has no effect on the command or its output.
This parameter takes string values, but you can also supply a PSModuleInfo or PSSnapinInfo object, such as the objects that Get-Module, Get-PSSnapin, and Import-PSSession return.
|
Required?
|
false
|
|
Position?
|
named
|
|
Default Value
|
None
|
|
Accept Pipeline Input?
|
true (ByPropertyName)
|
|
Accept Wildcard Characters?
|
false
|
-Name <string[]>
Gets information only about the cmdlets or command elements with the specified name. <String> represents all or part of the name of the cmdlet or command element. Wildcards are permitted.
To list commands with the same name in execution order, type the command name without wildcard characters. For more information, see the Notes section.
|
Required?
|
false
|
|
Position?
|
1
|
|
Default Value
|
|
|
Accept Pipeline Input?
|
true (ByValue, ByPropertyName)
|
|
Accept Wildcard Characters?
|
false
|
-Noun <string[]>
Gets cmdlets and functions with names that include the specified noun. <String> represents one or more nouns or noun patterns, such as "process" or "*item*". Wildcards are permitted.
|
Required?
|
false
|
|
Position?
|
named
|
|
Default Value
|
|
|
Accept Pipeline Input?
|
true (ByPropertyName)
|
|
Accept Wildcard Characters?
|
false
|
-Syntax
Gets only specified data about the command element.
* For aliases, retrieves the standard name.
* For cmdlets, retrieves the syntax.
* For functions and filters, retrieves the function definition.
* For scripts and applications (files), retrieves the path and filename.
|
Required?
|
false
|
|
Position?
|
named
|
|
Default Value
|
|
|
Accept Pipeline Input?
|
true (ByPropertyName)
|
|
Accept Wildcard Characters?
|
false
|
-TotalCount <int>
Gets only the specified number of command elements. You can use this parameter to limit the output of a command.
|
Required?
|
false
|
|
Position?
|
named
|
|
Default Value
|
|
|
Accept Pipeline Input?
|
true (ByPropertyName)
|
|
Accept Wildcard Characters?
|
false
|
-Verb <string[]>
Gets information about cmdlets and functions with names that include the specified verb. <String> represents one or more verbs or verb patterns, such as "remove" or *et". Wildcards are permitted.
|
Required?
|
false
|
|
Position?
|
named
|
|
Default Value
|
|
|
Accept Pipeline Input?
|
true (ByPropertyName)
|
|
Accept Wildcard Characters?
|
false
|
<CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters.
Without parameters, "Get-Command" gets information about the Windows PowerShell cmdlets and functions. Use the parameters to qualify the elements retrieved.
Unlike Get-Help, which displays the contents of XML-based help topic files, Get-Command gets its cmdlet information directly from the cmdlet code in the system.
Get-Command returns the commands in alphabetical order. When the session contains more than one command with the same name, Get-Command returns the commands in execution order. The first command that is listed is the command that runs when you type the command name without qualification. For more information, see about_Command_Precedence.