PowerShell: Find Command

By Xah Lee. Date: . Last updated: .

Show Documentation

help name
Show the doc or full name of a thing name. For example, type help dir and it'll show the doc for Get-ChildItem.

Find Command, List Commands

(gcm is alias of Get-Command)

gcm name
Check if a command name is available. (Command means any of {Cmdlet, Alias, Function, filter, Script, app}.) Result includes any app in the Environment Variables $env:path
gcm *z*
List command names that contain z.
gcm name -UseFuzzyMatching
List command names that match letters in name.
gcm name -all
Search all, including commands of the same type that have the same name. By default, Get-Command gets only the commands that run when you type the command name.
gcm name | fl
Make the full path of the command visible.
(fl is alias of Format-List)
gcm name | select -Property Path
Show just full path of the command.
(select is alias of Select-Object)
pwsh Get-Command 2021-01-16 hVdbf
list all commands that contains z in name.

List Alias, Find Full Name

PowerShell command can have aliases. For example, dir, ls, gci, are all the same as Get-ChildItem .

Show all aliases.
(Note: Get-Alias only work with alias. Some commands are functions, such as help, mkdir. Use help name to see what they are.)
Get-Alias *r
Show aliases ending in r
Get-Alias alias
Find the fullname of a alias alias. For example, Get-Alias dir

List All Alias of a Command Full Name

Get-Alias -definition cmdlet_name
List all aliases of a cmdlet. For example, Get-Alias -definition get-childitem


Practical How-To

PowerShell in Depth

Programing PowerShell

Script Examples