Get-Alias, What Alias?

Posted on Updated on

Yes PowerShell has aliases for its commands, a lot of them. While typing them out long hand does have intellisense and tab completion, its much easier if you get used to using the aliases of your most used commands. Even Get-Alias has an alias “gal” that will list to the console the basic information below. Figure 1 is not the complete list, just a snippet as the list is way too long, but the idea is that you can only look at it, you can’t open it and refer to it to learn them.

I exported them to a CSV using the line: gal | Export-CSV -Filename which gave me a lot more data and I just deleted the 10 rows I didn’t need. I could have went ahead and selected names to shorten the out too, but its always nice to see what PowerShell provides you. One thing it does for the Get-Alias that you don’t see is the Microsoft link to the help page for that command. See figure 2 below to see the output.

Not only save time with less typing, it gives me shortcuts to look at the whole command in a browser instead of in a console with Get-Help and needing to know the parameters that go with it.

Figure 1

CommandType Name
Alias gc  ->  Get-Content
Alias gcb  ->  Get-Clipboard
Alias gci  ->  Get-ChildItem
Alias gcm  ->  Get-Command
Alias gcs  ->  Get-PSCallStack
Alias gdr  ->  Get-PSDrive
Alias ghy  ->  Get-History
Alias gi  ->  Get-Item
Alias gjb  ->  Get-Job
Alias gl  ->  Get-Location
Alias gm  ->  Get-Member
Alias gmo  ->  Get-Module
Alias gp  ->  Get-ItemProperty
Alias gps  ->  Get-Process
Alias gpv  ->  Get-ItemPropertyValue
Alias group  ->  Group-Object
Alias gsn  ->  Get-PSSession
Alias gsnp  ->  Get-PSSnapin
Alias gsv  ->  Get-Service
Alias gu  ->  Get-Unique
Alias gv  ->  Get-Variable
Alias gwmi  ->  Get-WmiObject

Figure 2

HelpUri ResolvedCommandName Name Add-Content ac Add-PSSnapin asnp Clear-Content clc Clear-History clhy Clear-Host clear Clear-Host cls Clear-Item cli