PowerShell: List Alias, Find Alias

By Xah Lee. Date: . Last updated: .

PowerShell command can have aliase. For example, Get-ChildItem is the same as gci or dir.

List All Aliases

powershell list alias 2017 05 09
type gal to list alias
# show all aliases
# show aliases ending in r
Get-Alias *r

(Get-Alias has alias gal)

Find Fullname

# find fullname of alias “dir”
Get-Alias dir

# or
help dir

List a Cmdlet's Aliases

# list aliases of Get-Childitem
Get-Alias -definition get-childitem

Note that the above won't return functions. For example, typing “Get-Alias” will list “help” as a alias for “Get-Help”. However, Get-Alias -definition Get-Help will return a error. This is because, technically, “help” is the name of a function, not alias.

List Functions

# list all functions
Get-ChildItem function:*
powershell list functions 2017 05 09
list functions by dir function:*

List Commands

PowerShell has over 200 cmdlets and functions. Often, you need to know if there's a command that does what you want. You can search them by Get-Command.

# list all cmdlets whose name has z
Get-Command *z*

# list all aliases whose name starts with s
Get-Command -commandtype alias s*