PowerGUI Interactivity

There are many small nice things which I love about PowerGUI. One of them is its ability to transform every bit of interactivity present in PowerShell command-line into UI:

  • Prompts for parameters.
  • Prompts to confirm actions.
  • Prompts for mandatory parameters.
  • Error handling.

Our vision with PowerGUI has always been to give user as much information and interaction as we could get out of PowerShell.

Let’s see how command-line compares to UI for each of these items:

Prompts for parameters

In command-line, when you type in a cmdlet name, type -, and then use tab-completion to see all possible parameters.

New-Mailbox -

PowerGUI gives you a table with all parameters and associated help information:

PowerGUI gives rich parameter info

Prompts to confirm actions

In command-line, you’ll get asked to confirm potentially risky operations:

[PS] C:\>Remove-Mailbox ps64.local/Users/user_name_420

Are you sure you want to perform this action?
Removing the Mailbox “ps64.local/Users/user_name_420” will remove the Windows
user object and mark the mailbox in the database for removal.
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help
(default is “Y”):

Same thing in PowerGUI:

Confirmation dialog box

Prompts for mandatory parameters

In command-line, if you omit a mandatory parameter you’ll get prompted to supply one:

[PS] C:\>New-Mailbox

cmdlet New-Mailbox at command pipeline position 1
Supply values for the following parameters:

Same thing in PowerGUI but all shown in one handy dialog box:

Asking for mandatory parameters

Error handling

PowerGUI even shows you exactly the same errors when something goes wrong.


New-Mailbox : Cannot bind parameter 'UserPrincipalName' to the target. Exception set
F" is not valid for UserPrincipalName. Valid values are: Strings that includes '
At line:1 char:11
+ New-Mailbox <<<<


Error from PowerShell

Pretty cool, eh?


0 Responses to “PowerGUI Interactivity”

  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

My Recent Tweets


The posts on this blog are provided “as is” with no warranties and confer no rights. The opinions expressed on this site are mine and mine alone, and do not necessarily represent those of my employer - WSO2 or anyone else for that matter. All trademarks acknowledged.

© 2007-2014 Dmitry Sotnikov

April 2007
« Mar   May »

%d bloggers like this: