October 12th, 2015
0 reactions

PowerTip: Display Every PowerShell Example in Help

Doctor Scripto
Scripter

Summary: Display every Windows PowerShell example that Help contains.

Hey, Scripting Guy! Question How can I use Windows PowerShell to display every Help example that Windows PowerShell contains?

Hey, Scripting Guy! Answer Use Get-Command to retrieve all of the cmdlet names, pipe the output to Foreach-Object,
           and call Get-Help with the –Example switch, for example:

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

Note  GCM is an alias for Get-Command and % is an alias for Foreach-Object.

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 is closed.