PowerShell: List Alias, Find Alias

By Xah Lee. Date: . Last updated: .

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

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*

If you have a question, put $5 at patreon and message me.


xah powershell logo
  1. Install, Start, Exit
  2. Help Command
  3. as cmd.exe, bash
  4. list Alias
  5. Piping
  6. Env Vars
  7. Automatic Variables
  8. Write Script
  9. PowerShell vs Bash