PowerTip: Display Every PowerShell Example in Help

Doctor Scripto

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.

0 comments

Discussion is closed.

Feedback usabilla icon