PowerTip: Find PowerShell Aliases for Cmdlets from a Specific Module

Doctor Scripto

Summary: See how to find all Windows PowerShell aliases for cmdlets and functions exposed by a specific module.

Hey, Scripting Guy! Question How can I find all of the aliases defined for commands (functions or cmdlets) in a specific module?

        Hey, Scripting Guy! Answer Use the Get-Command cmdlet (gcm is alias) to return all the commands from the module, and then use the Get-Alias cmdlet (gal is alias) to look for aliases with a definition of the command name.

gcm -Module *utility* | % {gal -Definition $_.name -ea 0}

Note   *utility* is a wildcard pattern for the Microsoft.PowerShell.Utility module.


Discussion is closed.

Feedback usabilla icon