PowerTip: Find Renamed PowerShell 3.0 Cmdlets

Doctor Scripto

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

0 comments

Discussion is closed.

Feedback usabilla icon