PowerShell v3 fun with Get-Help and Out-GridView

PowerShell comes loaded with help documentation, and in PowerShell V3 this documentation is updated via the internet.  Now, lets have some fun with the Get-help and the updated Out-Gridview command.

The Out-Gridview cmdlet have a ‘-passthru‘ parameter that gives you the ability to select items from the popup window and the pass these values to the next command.  This is neat!!

Copy/paste the code below into your PS console to load the “Get-HelpTopics“:

Function Get-HelpTopics{
## - Have fun using PassThru switch to select item(s): (PowerShell V3 feature)
$HelpNames = (GET-HELP About_*) | select name;
foreach($i in ($HelpNames | Select name | Out-GridView -PassThru))
{
	$i | Select @{Label = 'Topic Selected'; Expression = {$_.Name}};
	Get-Help $i.Name -ShowWindow;
}
};

Then, to execute type “Get-HelpTopics” and the list of topics will be displayed in a popup window.

Hold the ‘Ctrl’ key to select/mark the topics you want to read, then click the ‘OK’ button when done.

As you can see you will get a series of popup windows documentation you can move around and read about PowerShell. At the same time you are seeing how helpful is the use of the ‘-passthru‘ parameter in the ‘Out-Gridview’, and the ‘-ShowWindow‘ parameter in the ‘Get-help’.

This is a fun way to start learning PowerShell.
** This is a Windows PowerShell V3 script **

This entry was posted in PowerShell, Resources. Bookmark the permalink.