Quantcast
Viewing all articles
Browse latest Browse all 36188

PowerTip: Find PowerShell Aliases for Cmdlets from a Specific Module

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

Image may be NSFW.
Clik here to view.
Hey, Scripting Guy! Question
 
How can I find all of the aliases defined for commands (functions or cmdlets) in a specific module?

        Image may be NSFW.
Clik here to view.
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.

Image may be NSFW.
Clik here to view.

Image may be NSFW.
Clik here to view.

Viewing all articles
Browse latest Browse all 36188

Trending Articles