Skip to content
Menu
The Lonely Administrator
  • PowerShell Tips & Tricks
  • Books & Training
  • Essential PowerShell Learning Resources
  • Privacy Policy
  • About Me
The Lonely Administrator

Summary Judgment

Posted on August 21, 2009August 21, 2009

While working on a new article for REDMOND magazine about PowerShell 2.0, I wanted to get some cmdlet information. I wanted an easy way to see a list of cmdlets for a given verb or noun. Of course that is easily done with Get-Command. However this only gives my the definition.

Manage and Report Active Directory, Exchange and Microsoft 365 with
ManageEngine ADManager Plus - Download Free Trial

Exclusive offer on ADManager Plus for US and UK regions. Claim now!

After a little experimenting I found that I could get the help synopsis with the actual Get-Help cmdlet, not the Help function. So combining the two gives me the results I need.

PS C:\> gcm -noun job | select Name,@{Name="Synopsis";Expression={(get-help $_).synopsis}} | ft -auto -wrap

Name        Synopsis
----        --------
Get-Job     Gets Windows PowerShell background jobs that are running
            in the current session.
Receive-Job Gets the results of the Windows PowerShell background jobs
            in the current session.
Remove-Job  Deletes a Windows PowerShell background job.
Start-Job   Starts a Windows PowerShell background job.
Stop-Job    Stops a Windows PowerShell background job.
Wait-Job    Suppresses the command prompt until one or all of the
            Windows PowerShell background jobs running in the
            session are complete.

This should work for most Get-Command expressions. Although you may need to tweak a bit. Here’s my solution for discovering about aliases:

PS C:\> gcm -type alias | select Name,ResolvedCommandName,@{Name="Synopsis";Expression={(get-help $_).synopsis}} | ft -wrap -auto

Have fun.


Behind the PowerShell Pipeline

Share this:

  • Click to share on X (Opens in new window) X
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on Mastodon (Opens in new window) Mastodon
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Pocket (Opens in new window) Pocket
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to print (Opens in new window) Print
  • Click to email a link to a friend (Opens in new window) Email

Like this:

Like Loading...

Related

3 thoughts on “Summary Judgment”

  1. jv says:
    August 21, 2009 at 4:19 pm

    Note: Works on V1 also.

    1. Jeffery Hicks says:
      August 21, 2009 at 4:47 pm

      Thanks for the confirmation. I assumed it would but I didn’t have a v1 instance handy to verify.

  2. Bart Vandyck says:
    August 29, 2009 at 4:55 pm

    Hi Jeffery,

    Nice stuff, I added a small menu to it, so now I just type the number of the command(s) returned and it gives me the examples..

    function Global:myHelp([string] $Cmd=$(Throw “Please provide a part of the command you are looking for”))
    {
    $results=gcm -noun $cmd
    $ColCmds=@()

    $iCount=0
    foreach ($result in $results)
    {
    $iCount++
    $objCmd = New-Object system.object
    $objcmd | Add-Member -type NoteProperty -name Count -value $iCount
    $objcmd | Add-Member -type NoteProperty -name Name -value $result.Name
    $objCmd | Add-Member -type NoteProperty -Name Synopsis -value (get-help $result).synopsis
    $colCmds += $objcmd

    }
    $colcmds | ft -auto -wrap
    Write-Host -fore yellow ” to quit”

    write-host -nonewline “Show Info 0 – ${iCount} : “;
    $choice=[console]::readline()
    if ($choice -and ($choice -lt 0) -or ($choice -gt $icount))
    {
    Write-Warning “‘${choice}’ is out of range!”
    continue;
    }
    if($choice)
    {
    Get-help $colcmds[$choice-1].name -examples
    }
    }

    Thx!!

Comments are closed.

reports

Powered by Buttondown.

Join me on Mastodon

The PowerShell Practice Primer
Learn PowerShell in a Month of Lunches Fourth edition


Get More PowerShell Books

Other Online Content

github



PluralSightAuthor

Active Directory ADSI Automation Backup Books CIM CLI conferences console Friday Fun FridayFun Function functions Get-WMIObject GitHub hashtable HTML Hyper-V Iron Scripter ISE Measure-Object module modules MrRoboto new-object objects Out-Gridview Pipeline PowerShell PowerShell ISE Profile prompt Registry Regular Expressions remoting SAPIEN ScriptBlock Scripting Techmentor Training VBScript WMI WPF Write-Host xml

©2025 The Lonely Administrator | Powered by SuperbThemes!
%d