December 29th, 2012

PowerTip: Find Which PowerShell Cmdlets Have Most Aliases

Doctor Scripto
Scripter

Summary: Find out which Windows PowerShell cmdlets have the most defined aliases.

Hey, Scripting Guy! Question How can I determine which Windows PowerShell cmdlets have the most aliases?

Hey, Scripting Guy! Answer Use the Get-Alias cmdlet and group by the definition. Sort the count in a descending manner, and select the top 10 items. The following command accomplishes this task where gal is an alias for Get-Aliasgroup is an alias for Group-Objectsort is an alias for Sort-Object, and select is an alias for Select-Object.

gal | group definition | sort count -Descending | select -First 10

 

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