August 7th, 2013

PowerTip: Use PowerShell to Display Help for Module Cmdlets

Doctor Scripto
Scripter

Summary: Use Windows PowerShell to display all Help for all cmdlets in a module.

Hey, Scripting Guy! Question How can I see all of the Help examples for cmdlets from a specific module?

Hey, Scripting Guy! Answer After you have updated your Help in Windows PowerShell 3.0, use the Get-Command cmdlet to retrieve all cmdlets from a specific module, pipe the results to the Foreach-Object cmdlet, and use the Get-Help cmdlet inside the script block. Following is an example for the PrintManagement module:

Get-Command -Module PrintManagement| Foreach-Object {get-help $_.name -Examples}

Here is a shorter version of the same command:

gcm -mo *print* | % {get-help $_.name -ex}

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.