CommandAssist is a new module designed to provide some graphical help for people who are new to PowerShell or just not as comfortable on the command line.  CommandAssist relies on ShowUI, so go get it now!

What’s There Now

The first three functions in this module are:

  1. Show-ParameterAssist
  2. New-AssistedModule
  3. Where-Object (with an updated –Assist parameter)

Show-ParameterAssist is the workhorse behind the coolest feature in this module.  Parameter assist takes a command (either a CommandInfo from Get-Command, or a command name and what type of command) and optionally a hashtable of parameters and values.  It provides a UI with all the parameters (grouped in tabs by parameter set).  The UI has parameter help, bolded Mandatory parameters, and let’s you pick enumerations from a drop down menu.

Show-ParameterAssist can be embedded in any function (in the begin block is most effective) before any logic executes.  You can assign the output to $PSBoundParameters and also use it to populate the variables for those parameters.  I’ll publish some examples soon.

New-AssistedModule takes a module and creates a new module with proxies for each command.  In these proxies, Show-ParameterAssist is exposed via an –Assist parameter.

The final command (so far) is the most raw.  The module exposes a proxy for Where-Object, with an –Assist parameter that provides a scriptblock builder for the filter.  The scriptblock builder has a list of all the properties exposed by incoming objects, as well as a list of all the comparison operators.  You can drag properties and operators onto the textbox to build a scriptblock.  When you have a valid scriptblock, the background turns green.  When it is invalid, the background is red.  Also kind of helpful is a counter showing the number of objects being evaluated.   When there is a valid scriptblock, there is also a counter saying how many objects will be output.

 

On the Horizon

For Show-ParameterAssist:

  • More information about the parameters (can it take pipeline input, etc..)
  • If a parameter takes a value by property name, include scriptblock evaluation like in Where-Object
  • Other requests

For Where-Object

  • Offer better information about the incoming properties.
  • Improve the drag and drop experience (and parens, and other commonly used cmdlets and expressions)
  • Improve the help
  • Other requests

For the module in general:

  • More built in assisted commands (like select-object)
  • ‘Improve the help
  • Other requests

If you think this module has some value or have a feature you would like to see, please leave a comment or ping me on twitter, or stop by the PowerScripting Podcast this evening and ask in the chat room.  Grab the scripts, look through them and let me know what you think!