PowerShell Universal 2.2

PowerShellUniversal

August 2, 2021

quote Discuss this Article

I’m very happy to announce the release of PowerShell Universal v2.2! 🎉

PowerShell Universal allows you to build internal, web-based tools with PowerShell. Create APIs, run and schedule scripts and build user interfaces.

This release focuses on a new feature: Pages. Pages are an alternative to dashboards that do not require you to learn any frameworks to produce UIs that can invoke PowerShell scripts and consume and display the output from them.

Pages feature a drag and drop designer that allows you to manage the layout and set properties of over a dozen components.

Certain components also support invoking scripts (like buttons and forms) or consuming output from APIs and Scripts (like tables and charts). In the below example, Script.ps1 calls Get-Process. The output from the last run job is shown in the table.

You can try out the new page designer by downloading PowerShell Universal 2.2.

Download Now

Dashboards vs Pages

With the introduction of pages, PowerShell Universal now provides two user interface options. Below you’ll find some notes on the differences.

Dashboards provide an extremely powerful method of developing full featured web-apps with PowerShell. You can create highly customized and dynamic applications that consume and invoke PowerShell. The possibilities are endless. With this amount of flexibility, the learning curve is high and can require substantial knowledge of PowerShell to build even basic tools. Dashboards are stored as PS1 files and executed when users visit the web site.

Pages provide a simple approach to display data from PowerShell as well as allowing users to invoke scripts in a web-based GUI. The tooling is easier to use and doesn’t require coding the UI by hand. Pages do not provide as much flexibility as dashboards. Pages are stored as XML rather than PS1 since they are more static and do no execute PowerShell when a user visits the website.

Components

PowerShell Universal currently offers 14 components in the page designer.

Alerts

Alerts allow you to display messages that stand out on the page. You can set various styles of alerts.

Bar Charts

You can consume output from scripts and APIs to create simple bar charts. In this example, we are consuming an API that runs the following script.

@(
    [PSCustomObject]@{ name = "name1"; value = (Get-Random) }
    [PSCustomObject]@{ name = "name2"; value = (Get-Random) }
    [PSCustomObject]@{ name = "name3"; value = (Get-Random) }
    [PSCustomObject]@{ name = "name4"; value = (Get-Random) }
    [PSCustomObject]@{ name = "name5"; value = (Get-Random) }
) | ConvertTo-Json

Within the page, the bar chart X Axis Field is set to name and the Y Axis Field is set to value. The result chart looks like this.

Buttons

Buttons can be added that invoke scripts or APIs. You can configure the parameters that are passed to each. You can configure the text and icon of the button.

To invoke a script or API, set the target of the button in the properties.

Forms

Forms allow for invoking APIs and scripts based on user input. You can configure the fields displayed to the user.

Just like buttons, you can select the API or script to execute. Fields can be added on the properties menu.

Images

Add simple images to a page with support for lightbox.

Line Charts

Similar to bar charts, line charts can consume API and script output. Here’s an example of consuming the same API as above.

Liquid Charts

Liquid charts display a percentage with a smooth animation and customizable colors.

Statistics

Statistics allow you to display numbers in a card with a title and a configurable prefix and suffix. You can also enable auto refresh to update the stats on an interval.

Tables

Tables consume APIs and Scripts to display the output. You can configure the columns to display. Tables automatically support paging.

Typography

Three types of typography are available. You can add text, paragraphs and titles. Each allow you to adjust the color and style.

Get Started

To get started with PowerShell Universal v2.2, download the latest version from our downloads page.