This is the the meat of CommandAssist module, providing a contextual assistant to supplying the right parameters to a command.

Getting to the Meat of It

In the last post, we created a proxy module for ActiveDirectory module, so what does that really get for us?

Starting off in a new shell, I’ve imported the AssistedAD module and I’m going to try out the -Assist parameter for Get-ADUser

Import-Module ADAssistGet-ADUser -Assist

Initially, I was prompted for a Filter parameter, as that parameter is marked mandatory in the default parameter set. I supplied a "*" and moved on. You’ll notice that I did not have to load the ActiveDirectory module, the CommandAssist module or the ShowUI module, as the proxy module handles all that in the background for you.

What I then got was:

 

image

You’ll notice that there are three tabs, Filter, LdapFilter, and Identity.  Each tab represents a parameter set and shows the associated parameters for that set. 

You will only be able to pass parameters for one parameter set, which can alleviate the common error of

Parameter set cannot be resolved using the specified named parameters

This is a key benefit of CommandAssist versus other tab completion options.

As you add parameters, the command line at the top will change to reflect your changes to the parameters.

image

Parameters that take a specified enumeration (like AuthType in this case) will have a dropdown box with the available options.

If I change parameter sets, the command line changes to reflect my new parameter selections.

image

However, your previous selections on an alternate tab have not changed, so you can return to that tab and continue editing if you determine that is the appropriate parameter set to use.

 

What other information would you like to see here?

Please post a comment on the blog or a message on Twitter if any additional information or features you think might be useful for this!  I’d love to hear how you think this might provide value in your usage or your environment.