More Discover PowerShell – How about Help with PowerShell Variables?

Finally got this last function working in order¬†and created a new module: “DiscoverPowershell” with all three Show-Help* functions:

1. Show-HelpPowerShellCommand – Meant to select one module at the time and then multiple commands.
2. Show-HelpAboutPowerShellTopic – Multi-select can be applied.
3. Show-HelpPowerShellObject (New) – Multi-select can be applied.
Check out the first two functions on my previous blog.

In the module I tweak is just a little bit but the functionality stay the same. Basically, you can select multiple Item(s) in the Out-Gridview and display the results.

Here’s the link to download and install the module folder “DiscoverPowerShell“:¬†https://onedrive.live.com/redir?resid=7FD7082276C66197!30947&authkey=!AKkr99vUvdqDKCw&ithint=file%2c.zip

*Note: Module requirements: PowerShell V4 (or greater) on Windows 7, Windows 8.1 and Windows 2012 R2.

Here’s the third function: Show-HelpPowerShellObject

function Show-HelpPowerShellObject
{
<#
.SYNOPSIS
Function to list all PowerShell Variable objects in your current session.

.DESCRIPTION
This function will display in the 'Out-Gridview' a list of all PowerShell Variable objects in your
session. Press the Crtl-Key and select the PowerShell variable you want to Display information.

.PARAMETER No Parameter(s) required.

.EXAMPLE
Show-HelpPowerShellObject
#>

[CmdletBinding()]
Param ()

[Array] $selItem = $null; [Array] $myObj = $null;
While ($selItem -eq $null)
{
$selItem = Get-Variable `
| Select name, @{ Label = 'objectType'; Expression = { $_.GetType(); } }, value `
| Sort-Object Name | Out-GridView -PassThru -Title "Select the PSVariable Object";
If ($selItem -eq $null) { break };
[Array] $myObj = $null;
ForEach ($myObj in $selItem.Name)
{
((get-variable $myObj).Value) | get-member `
| Out-GridView -Title ('Displaying Selected PSObject - $' + "$myObj");
};
If ($myObj -eq $null) { break };
$selItem = $null;
}
};
Copy/Paste code

Copy/Paste code

Multi-select items

Multi-select items

Selected items displayed and back to list

Selected items displayed and back to list

It’s all about having fun with PowerShell!!

This entry was posted in PowerShell, Windows 2012, Windows 8. Bookmark the permalink.