March 9th, 2013

PowerTip: Find Renamed PowerShell 3.0 Cmdlets

Doctor Scripto
Scripter

Summary: Use Windows PowerShell in Windows 8 or Windows Server 2012 to find renamed cmdlets.

Hey, Scripting Guy! Question You recently discovered that a cmdlet you had used on Windows Server 2008 R2 has been renamed in Windows Server 2012. Because an alias was created that mapped the old cmdlet name to the new cmdlet name, it took you awhile to discover the rename. How can you find all the renamed cmdlets?

Hey, Scripting Guy! AnswerUse the Get-Module cmdlet to find all installed modules and pipe the results to the Import-Module cmdlet (do this on a computer that has the RSAT installed). Now use the Get-Alias cmdlet with a wild card pattern to discover the renamed cmdlets with aliases that match old names. Finally, select the name of the alias (which shows the old cmdlet name) and the definition of the alias (which shows the new cmdlet name).

Get-Alias *-* | select name, definition

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.

Feedback