We’re excited to release another awesome version of Universal Automation. Universal Automation is the automation platform for PowerShell. Find out more about Universal Automation v1.3 below.

Automatic PowerShell Forms

In order to make scripts even easier to use, we are introducing the ability to interact more closely with the parameters of your scripts. Rather than just presenting a textbox, Universal Automation will now present controls based on the type of parameter.

Strings and Textboxes

Textboxes will be used for string parameters as well as parameters of unknown types that do not have a custom control designated for them.

param(
    [String]$Field1,
    $Field2
)

Switch and Boolean Parameters

Switch and Boolean parameters will present a switch button for the user to click.

param(
    [bool]$Field1,
    [Switch]$Field2
)

Integers

A number picker will be presented when an integer type is used for parameters.

param(
    [int]$Field1
)

Date and Time

If you specify a DateTime type for your parameter, a date and time picker will be presented.

param(
    [DateTime]$Field1
)

PSCredentials

If you specify a PSCredential type, you will receive a drop-down that allows you to access credentials stored within your credential store. These credentials will be retrieved from the store during execution.

param(
    [PSCredential]$Field1
)

Enums and ValidateSet Parameters

If you specify an enum type, such as System.ConsoleColor, or use the ValidateSet attribute on your parameter, the user will be provided with a drop-down list of items to select.

param(
    [System.ConsoleColor]$Field1,
    [ValidateSet('Value1', 'Value2')]
    $Field2
)

Mandatory Parameters

If you mark your parameters are mandatory, a red asterisk will appear next to the field. The user will be required to enter data into that field before running the script.

param(
    [Parameter(Mandatory)]
    [string]$Field1
)

Help Message

To provide additional context to form fields, you can specify the HelpMessage argument to the Parameter attribute. This text will be presented as a tooltip for the control.

param(
    [Parameter(HelpMessage = "This field is for data.")]
    [string]$Field1
)

Compact Interface

We’ve moved the navigation bar. This will allow for expansion of the options available and allow for better use of the space. The navigation bar is also collapsible.

Conclusion

The new Automatic PowerShell Form feature is now available in both Server and Desktop edition of Universal Automation. You can download installers from our Downloads page and UA Desktop should automatically update if you have it installed.