It’s all about discovering and exploring with PowerShell

Nothing like discovering and exploring what’s already at your fingertip. All you need to get started with PowerShell is already loaded in your system. There are plenty help documentation to keep you busy for awhile.

It’s time to get serious with PowerShell.

Checkout this year TechEd PowerShell session with Don Jones and Jeffrey Snover:

Now, using two known commands: Out-Gridview and Get-help we can search for help information in a flash.  Here I’m providing two custom PowerShell functions that might help you in exploring and learning about PowerShell:

1. Show-HelpPowerShellCommand – Select the module and then which command(s) to display thedocumentation.
2. Show-HelpAboutPowerShellTopic – Select the topic(s) to display the documentation.

Just copy/paste the code into a script file then load them in either PowerShell console or ISE.  To execute the command just type the function name: Show-HelpAboutPowerShellTopic or Show-HelpPowerShellCommand.

[sourcecode language=”powershell”]
function Show-HelpAboutPowerShellTopic
{
<# .SYNOPSIS Function to list all PowerShell About_* topic from the selected list. .DESCRIPTION This function will display in the ‘Out-Gridview’ a list of all PowerShell About_* topics installed in the system. Then, you can select one or multiples topic(s) available. Press the Crtl-Key and select the command(s) you want to get the help documentation. .PARAMETER No Parameter(s) required. .EXAMPLE Show-HelpAboutPowerShellTopics #>

[CmdletBinding()]
Param ()

[Array] $Global:selAbout = $null;
While ($Global:selAbout -eq $null)
{
[Array] $Global:selAbout = $null;
$Global:selAbout = ((Get-Help About_* | Select-Object Name) `
| Out-GridView -PassThru -Title "Listing all PowerShell About_* topics");

if ($Global:selAbout -eq $null) { break };
foreach ($item in $Global:selAbout) { Get-Help $item.Name -ShowWindow };
$Global:selAbout = $null;
};
};
[/sourcecode]

Check the image samples of Show-HelpAboutPowerShellTopic:

Loading Show-HelpAboutPowerShellTopics
Loading Show-HelpAboutPowerShellTopics
Selecting multiple topics
Selecting multiple topics
Viewing results and back to topics listing
Viewing results and back to topics listing

[sourcecode language=”powershell”]
function Show-HelpPowerShellCommand
{
<# .SYNOPSIS Function to list all cmdlets from the selected module(s). .DESCRIPTION This function will display in the ‘Out-Gridview’ a list of all PowerShell modules installed in the system. Then, you can select one of the modules to list all commands available in another ‘Out-Gridview’ window. Press the Crtl-Key and select the command(s) you want to get the help documentation. .PARAMETER No Parameter(s) required. .EXAMPLE Show-HelpPowerShellCommand #>

[CmdletBinding()]
Param ()

[Array] $selItem = $null; [Array] $selCmdlet = $null;
While ($selItem -eq $null)
{
$selItem = get-module -ListAvailable | Select-Object -Unique name, version, path `
| Sort-Object Name | Out-GridView -PassThru;
If ($selItem -eq $null) { break };
[Array] $selCmdlet = $null;
$selCmdlet = (Get-Command -Module $selItem.Name) | Sort-Object Name `
| Out-GridView -PassThru -Title "Module: $($selItem.Name) Total cmdlets: $(((Get-Command -Module $selItem.Name) | Sort-Object Name).count)";
$selItem = $null;
ForEach ($cmd in $selCmdlet) { Get-Help $cmd.Name -ShowWindow; };
If ($selCmdlet -eq $null) { break };
}
};
[/sourcecode]

Loading Show-HelpPowerShellCommand
Loading Show-HelpPowerShellComman
Select one module first
Select one module first
Select cmdlet(s)
Select cmdlet(s)
View help and exit list
View help and exit list

Please notice that these functions will stay active until you click on ‘Cancel’ in either of the select Topics or Module list.

I’m hoping this will make it fun to use.