PS C:\Users\edwils> Get-Alias | Sort CommandType Name Definition ----------- ---- ---------- Alias % ForEach-Object Alias ? Where-Object Alias ac Add-Content Alias asnp Add-PSSnapin Alias cat Get-Content Alias cd Set-Location Alias chdir Set-Location Alias clc Clear-Content Alias clear Clear-Host Alias cli Clear-Item Alias clp Clear-ItemProperty Alias cls Clear-Host Alias clv Clear-Variable Alias copy Copy-Item Alias cp Copy-Item Alias cpi Copy-Item Alias cpp Copy-ItemProperty Alias cvpa Convert-Path Alias del Remove-Item Alias diff Compare-Object Alias dir Get-ChildItem Alias echo Write-Output Alias epal Export-Alias Alias epcsv Export-Csv Alias erase Remove-Item Alias fc Format-Custom Alias fl Format-List Alias foreach ForEach-Object Alias ft Format-Table Alias fw Format-Wide Alias gal Get-Alias Alias gc Get-Content Alias gci Get-ChildItem Alias gcm Get-Command Alias gdr Get-PSDrive Alias gh Get-Help Alias ghy Get-History Alias gi Get-Item Alias gl Get-Location Alias gm Get-Member Alias gp Get-ItemProperty Alias gps Get-Process Alias group Group-Object Alias gsnp Get-PSSnapin Alias gsv Get-Service Alias gu Get-Unique Alias gv Get-Variable Alias gwmi Get-WmiObject Alias h Get-History Alias history Get-History Alias iex Invoke-Expression Alias ihy Invoke-History Alias ii Invoke-Item Alias ipal Import-Alias Alias ipcsv Import-Csv Alias kill Stop-Process Alias lp Out-Printer Alias ls Get-ChildItem Alias mi Move-Item Alias mount New-PSDrive Alias move Move-Item Alias mp Move-ItemProperty Alias mv Move-Item Alias nal New-Alias Alias ndr New-PSDrive Alias ni New-Item Alias nv New-Variable Alias oh Out-Host Alias popd Pop-Location Alias ps Get-Process Alias pushd Push-Location Alias pwd Get-Location Alias r Invoke-History Alias rd Remove-Item Alias rdr Remove-PSDrive Alias ren Rename-Item Alias ri Remove-Item Alias rm Remove-Item Alias rmdir Remove-Item Alias rni Rename-Item Alias rnp Rename-ItemProperty Alias rp Remove-ItemProperty Alias rsnp Remove-PSSnapin Alias rv Remove-Variable Alias rvpa Resolve-Path Alias sal Set-Alias Alias sasv Start-Service Alias sc Set-Content Alias select Select-Object Alias set Set-Variable Alias si Set-Item Alias sl Set-Location Alias sleep Start-Sleep Alias sort Sort-Object Alias sp Set-ItemProperty Alias spps Stop-Process Alias spsv Stop-Service Alias sv Set-Variable Alias tee Tee-Object Alias type Get-Content Alias where Where-Object Alias write Write-Output PS C:\Users\edwils> Get-Help Get-Alias -Full NAME Get-Alias SYNOPSIS Gets the aliases for the current session. SYNTAX Get-Alias [[-name] ] [-scope ] [-exclude ] [] DETAILED DESCRIPTION The Get-Alias cmdlet gets the alternate names for cmdlets, functions, and executable files that have been establish ed for the current session. This collection includes built-in aliases, aliases that you have set or imported, and a liases that you have added to your Windows PowerShell profile. If you specify one or more aliases, Get-Alias gets t he alias object and displays its properties, including the object that was aliases, such as the full name of a cmdl et. This feature is made available by the Windows PowerShell Alias provider. PARAMETERS -name Specifies the alias to retrieve. By default, Get-Alias retrieves all aliases defined for the current session. T he parameter name ("-Name") is optional. Required? false Position? 1 Default value * Accept pipeline input? true (ByValue, ByPropertyName) Accept wildcard characters? true -scope Specifies the scope in which this alias is valid. Valid values are "Global", "Local", or "Script", or a number relative to the current scope (0 through the number of scopes, where 0 is the current scope and 1 is its parent ). "Local" is the default. For more information, type "get-help about_scope". Required? false Position? named Default value All locally visible aliases Accept pipeline input? false Accept wildcard characters? false -exclude Omits the specified items. The value of this parameter qualifies the Name parameter. Enter a name element or pa ttern, such as "s*". Wildcards are permitted. Required? false Position? named Default value Accept pipeline input? false Accept wildcard characters? true This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, and -OutVariable. For more information, type, "get-help about_commonparameters". INPUT TYPE None RETURN TYPE aliasInfoObject NOTES For more information, type "Get-Help Get-Alias -detailed". For technical information, type "Get-Help Get-Alias -full". An alias is an alternate name or nickname for a cmdlet, function, or an executable file. To run the cmdlet, fun ction, or executable, you can use its full name or any alias. For more information, type "get-help about_alias" . When specifying multiple values for a parameter, use commas to separate the values. For example, " , ". You can also refer to Get-Alias by its built-in alias, "gal". To create a new alias, use Set-Alias or New-Alias. To delete an alias, use Remove-Item. -------------------------- EXAMPLE 1 -------------------------- C:\PS>get-alias This command retrieves all aliases for the current session. The default display includes the CommandType (always "A lias"), the name of the alias (in the Name column), and the cmdlet that is aliased (in the "Definition" column). -------------------------- EXAMPLE 2 -------------------------- C:\PS>get-alias -name g*, s* This command retrieves all aliases that begin with "g" or "s". -------------------------- EXAMPLE 3 -------------------------- C:\PS>get-alias | where-object {$_.Definition -match "Get-Childitem"} In its simplest form, the Get-Alias cmdlet retrieves the cmdlet name when you know the alias. However, you can use this command format to find the aliases when you know the cmdlet name. The name of the aliased cmdlet is stored in the Definition property of the alias. So, to find the aliases for a giv en cmdlet, you search for aliases with a Definition property that matches the cmdlet name. First, the command retrieves all aliases ("get-alias"), and then it pipes the results to the Where-Object cmdlet. T he "{$_.definition -match "get-childitem"}" element tells Where-Object to retrieve only the aliases in which the va lue of the Definition property is "Get-Childitem". The result is a list of all of the aliases for the Get-Childitem cmdlet. Definition is just one property of the AliasInfo objects that Get-Alias retrieves. To find all properties and metho ds of AliasInfo objects, type "get-alias | get-member". -------------------------- EXAMPLE 4 -------------------------- C:\PS>get-alias | where-object {$_.Options -match "ReadOnly"} This command retrieves all aliases in which the value of the Options property is ReadOnly. This command provides a quick way to find the aliases that are built into Windows PowerShell, because they have the ReadOnly option. First, the command retrieves all aliases ("get-alias"), and then it pipes the results to the Where-Object cmdlet. T he "{$_.Options -match "ReadOnly"}" element tells Where-Object to retrieve only the aliases in which a value of the Options property is "ReadOnly". Options is just one property of the AliasInfo objects that Get-Alias retrieves. To find all properties and methods of AliasInfo objects, type "get-alias | get-member". -------------------------- EXAMPLE 5 -------------------------- C:\PS>(get-alias | where-object {$_.Options -match "ReadOnly"}).count This command displays the number of aliases with the ReadOnly option. It saves you from tedious counting and lets y ou compare sets of objects with different properties. This command is identical to the command in the previous example, except that the previous command is now enclosed within parentheses and is followed by the ".count" property. Windows PowerShell first executes the command within the parentheses. Then, instead of displaying the results, it c ounts the results and displays the number counted. To count the number of objects retrieved by any command, just enclose the command in parentheses and append ".count ." -------------------------- EXAMPLE 6 -------------------------- C:\PS>get-alias | out-string -stream | select-string "Get-Command" This command displays aliases that includes the phrase "Get-Childitem". Unlike the previous command, this one finds the phrase in any property of the alias. It also demonstrates the difference between working with objects and work ing with strings. The command uses the Get-Alias cmdlet to get a set of AliasInfo objects; one for each alias in the shell. The pipeline operator (|) sends the output to Out-String, which converts the objects to a series of strings. It use s the Stream parameter to send each string individually, instead of a single string. Another pipeline operator send s the strings to Select-String, which selects the strings that contain "Get-Command" anywhere in the string. If you omit the Stream parameter, the command displays all of the aliases, because Select-String finds "Get-Command " in the single string that Out-String returns, and the formatter displays the string as a table. For information about Out-String, type "Get-Help Out-String -detailed". RELATED LINKS Set-Alias New-Alias Export-Alias Import-Alias PS C:\Users\edwils> Set-Alias gh Get-Help PS C:\Users\edwils> Get-Alias gh CommandType Name Definition ----------- ---- ---------- Alias gh Get-Help