Share This Post

Working with PowerShell Alias

As you guessed, PowerShell has built-in Alias to help you reduce your keystrokes or to “simulate” the command from another scripting language. For example, cd is the PowerShell Alias for set-location and pwd is the Alias for get-location.

Get-Alias (ls Alias: ) will list the aliases for the current session which includes built-in alias, aliases that you have set.

You can create your own alias using new-alias:

Set-Alias help get-help

By default, aliases(you created) are not saved between Windows PowerShell sessions: each time you restart Windows PowerShell you will need to recreate the alias. To permanently save your alias, create a file named Microsoft.PowerShell_profile.ps1 and add the following line:

Set-Alias help Get-Help

and save it in C:\WINDOWS\system32\windowspowershell\v1.0 folder.

Share This Post

Ying Li obtained a Master degree of Medicine in China and worked in the medical field before he came to the states in 1996. He made the career switch from troubleshooting people to troubleshooting computers after he came to the states. Not entirely a surprise there, if you know that his second preference for college is Mathematics. Ying is two times Admin Framework MVP awardee (2007-2008).His previous employment experience in the US includes UUNET, MCI WorldCom. MMC (Marsh & McLennan Companies), Merrill Lynch. He is currently employed by Related Companies as a Senior Infrastructure Engineer. He is proficient in virtually all Microsoft products (Office/Back office). His craving for efficiency naturally leads him to scripting, automation and before you know it, PowerShell! He is currently a MCSE (NT4, 2000, 2003) and MCITP Server Administrator. Ying enjoys wines and love to travel. His non work related passion is to advocate Health Living!

Leave a Reply