How to find cmdlet aliases in PowerShell
Aliases in PowerShell are alternate names given to commands. You can think of them as nicknames for commands. For example, pwd
is an alias of Get-Location
, and rm
is an alias for Remove-Item
. Aliases are useful for shortening the name of a command, or to provide a different name that may be more familiar to the user.
Get the aliases for all PowerShell cmdlets
The Get-Alias
cmdlet is used to display all the aliases that are available in
the current PowerShell session:
Get-Alias
Check the alias for a specific PowerShell cmdlet
To check the alias for a specific cmdlet, pass the cmdlet name to the
-Definition
parameter as shown below:
Get-Alias -Definition New-Item
As you can see from the above output, ni
is the alias for New-Item
in this
case.
Thanks for reading, and happy scripting!