PowerShell Universal 1.5

PowerShell PowerShellUniversal

November 17, 2020

quote Discuss this Article

PowerShell Universal v1.5

Ironman Software is pleased to announce another feature-packed PowerShell Universal release! Today, we’re releasing version 1.5 of the ultimate platform for building web-based IT tools. This release contains a variety of new features as well as bug fixes that we suggest all users considering upgrading to.

This blog post will cover some of the main features. To see a detailed demo of some of the notable highlight features, watch the following video or check out the full release notes:

Release Notes

https://docs.ironmansoftware.com/changelog

Downloads

Platform

Single-File Hosting and Configuration

With PowerShell Universal 1.5, it’s now easier than ever to get started and develop by providing the capability to run the entire platform right from a single file. The Start-PSUServer and Install-PSUServer cmdlets can be used to install, configure, and run a Universal instance without having to create a rigid file structure.

Single-file hosting will automatically reload the PowerShell Universal configuration as you make changes to the file. You can try it yourself by running the following script.

$Path = Join-Path $Env:ProgramData "PowerShellUniversal"

Install-Module Universal
Install-PSUServer -LatestVersion -Path $Path
Start-PSUServer -Port 8080 -Configuration {
    New-PSUEndpoint -Url '/hello' -Method GET -Endpoint {
        'Hello'
    }
    New-PSUDashboard -Name 'Dashboard' -BaseUrl '/dashboard' -Framework 'UniversalDashboard:Latest' -Content {
        New-UDDashboard -Title 'Hello, World' -Content {
            New-UDForm -Content {
                New-UDTextbox -Label 'Say Hi' -Id 'textbox'
            } -OnSubmit {
                Show-UDToast -Message $EventData.textbox
            }
        }
    }
} -ExecutablePath (Join-Path $Path "Universal.Server.exe")

Learn more about single-file hosting on the documentation.

Server-wide cache

PowerShell Universal administrators now have a new and simple way to share data between APIs, Dashboards and Automation using server-wide caching. This feature provides a ubiquitous set of PowerShell cmdlets that can be used to Set and Get values that are instantly available to all of PowerShell Universal. This provides administrators a simple way to share data between components without needing to implement their own cache or storage solution.

Set-PSUCache -Key "CurrentDate" -Value (Get-Date)
Get-PSUCache -Key "CurrentDate"

Learn more about server-wide caching on the documentation.

Configuration Improvements

We’ve spent a lot of time streamlining the configuration system to more consistently reload changes that you make while developing your PSU solution. The improved configuration system no longer relies on the database file and uses your PS1 files as the single source of truth for configuration within the platform. Configuration is now cached in-memory to provide the best performance possible.

Improve App Token Management

We’ve improved the UI and API for generating app tokens to allow for creating tokens for alternate identities, roles and life times.

Mac OS Support

You can now run PowerShell Universal on your Mac. Mac OS builds are officially available for download.

PSModulePath Support for Environments

Environments can now set custom PSModulePaths to allow for discovery of modules without having to enter the path of each module.

Custom Login Pages

Login pages can now be customized to include custom logos and colors to provide consistent branding for your organization. You can define the login page within the loginPage.ps1 file or within your single-file configuration.

$LoginPage = @{
    PrimaryColor = '#5c2751' 
    Title = 'DBATools Web Portal'
    Copyright = 'DBATools 2020' 
    HeaderFontColor = white 
    HeaderColor = '#4bc0d9' 
    SecondaryColor = '#6457a6'
    SecondaryFontColor = 'white'
    Image = http://localhost:5000/images/dbatools.png 
}

New-PSULoginPage @LoginPage

Learn more about custom login pages on the documentation.

APIs

APIs allow you to create REST endpoints using PowerShell.

Property Editing for Endpoints

We’ve added the ability to edit APIs directly in the UI after creating them.

Automation

Automation allows you to execute and schedule PowerShell scripts.

Triggers

Triggers is a new Automation feature that allows PowerShell Universal administrators to configure automation jobs to start (“Trigger”) when certain events happen within PowerShell Universal. For example, this allows you to take action when jobs complete, the server starts, or dashboards stop. Triggers can be applied to specific resources or globally to implement global error handling, operational notifications, or change control/monitoring.

Learn more about triggers on the documentation.

Execute-Only Permissions for Automation

We’ve added a new role to provide the ability to execute scripts in Automation but prevent the user from editing the script.

Per-Script Concurrent Execution Limits

You can now configure per-script concurrent script execution limits to prevent particular scripts from running more than you define.

New-PSUScript -Name 'Script.ps1' -Path 'Script.ps1' -ConcurrentJobs 1

Support for String Arrays in Param blocks

String arrays are now supported in param blocks and will display a multi-tag component within the UI to allow users to enter multiple string values.

param([string[]]$Array)

$Array

Dashboards

Dashboards allow you to create websites with PowerShell.

New-UDTable Improvements

One of the most popular components of Universal Dashboard UDTable has received a series of enhancements that should greatly appeal to many users of Universal Dashboard.

This includes but is not limited to:

Learn more about UDTable on the documentation.

Universal Dashboard v3 Module

The PowerShell Universal Dashboard v3 framework is now published to the PowerShell Gallery for easier installation and a better developer experience when creating dashboards with PowerShell Universal.

Install-Module UniversalDashboard
Install-PSUServer
Start-PSUServer -Port 8080 -Content {
    New-PSUDashboard -Name 'Dashboard' -BaseUrl '/' -Framework 'UniversalDashboard:Latest' -Content {
        New-UDDashboard -Title 'Hello' -Content {
            New-UDTypography -Text 'Hello, world!'
        }
    }
}

UDMonitor Component

We’ve adapted the popular chart component from Universal Dashboard v2 and added it to our charts component library.

New-UDChartJSMonitor -LoadData {
    Get-Random -Max 100 | Out-UDChartJSMonitorData
} -Labels "Random" -ChartBackgroundColor "#297741" -RefreshInterval 1

Date and Time Component

The new date and time component can be used for format date and time values to match the timezone of the user loading the dashboard.

New-UDDateTime -InputObject (Get-Date) -Format 'DD/MM/YYYY'

Latest Dashboard Framework

By default, new dashboards will now use the latest Universal Dashboard framework. This means that you have the option to leave this setting alone and during PowerShell Universal upgrades, the framework will also automatically upgrade.

Default Documents for Published Folders

Published folders can now define a default document. By being able to specify a default document on a published folder, you can now host static web pages with PowerShell Universal.

New-PSUPublishedFolder -Path C:\website -RequestPath /docs -DefaultDocument @("index.hml")

Conclusion

PowerShell Universal 1.5 is the best version of the platform yet. Start building web-based tools using PowerShell today.