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.
PowerGUI gives you a table with all parameters and associated help information:
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:
Prompts for mandatory parameters
In command-line, if you omit a mandatory parameter you’ll get prompted to supply one:
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:
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 <<<<
Pretty cool, eh?