How to rename an alias in PowerShell?
- by jwfearn
I want to make my own versions of some of the builtin PowerShell aliases. Rather than completely removing the overridden aliases, I'd like to rename them so I can still use them if I want to. For example, maybe I'll rename set to orig_set and then add my own new definition for set.
This is what I've tried so far:
PS> alias *set*
CommandType Name Definition
----------- ---- ----------
Alias set Set-Variable
PS> function Rename-Alias( $s0, $s1 ) { Rename-Item Alias:\$s0 $s1 -Force }
PS> Rename-Alias set orig_set
PS> alias *set*
CommandType Name Definition
----------- ---- ----------
Alias set Set-Variable
Any ideas as to why this isn't working?