Click to Rate and Give Feedback
TechNet
TechNet Library
Scripting
Script Center
Windows PowerShell
Cmdlets
 Using the Set-Alias Cmdlet
What Can I Do With Windows PowerShell?
Using the Set-Alias Cmdlet

Remapping an Existing Windows PowerShell Alias

Set-Alias allows you to map an existing alias to a different cmdlet. For example, suppose you have an alias named show that, for some reason, is mapped to the Remove-Item cmdlet. You’d prefer that show be mapped to Get-ChildItem. Well, why didn’t you say so:


Set-Alias show Get-ChildItem

Just call Set-Alias followed by the alias name, followed by the appropriate cmdlet. That’s all you have to do.

Although there’s no corresponding cmdlet set aside for removing a mapped alias, you can achieve that task by using Remove-Item:


Remove-Item alias:\show
Related Links

© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker