About

Learn about tools built with PowerShell and Blazor.

Tools are user interfaces build with PowerShell and Blazor. You can create robust web-based used interfaces with minimal web development experience.

What is PSBlazor Syntax?

PSBlazor is a custom XML syntax based on Blazor. PSBlazor allows for declarative interfaces to be built without the need to write HTML or JavaScript. It integrates with PowerShell through data binding, event callbacks to functions and provides access to services provided by PowerShell Universal.

An example PSBlazor XML document would look something like this.

<Button OnClick="ClickMe" Icon="user">Title</Button>

Alongside the .razor file, a .psm1 module file is also created. This file contains all the logic for the PSBlazor page or component. These module files are standard PowerShell script with variables for accessing and updating the PSBlazor interface.

The following example would display a message box in the interface with the text Ouch!.

function ClickMe {
    $MessageService.Error("Ouch!")
}

How are PowerShell and Blazor apps different?

PowerShell Apps are built entirely using PowerShell script and typically run within their own process. By using PowerShell script, you can create very customized interfaces that do not require any other languages.

Blazor Apps run within the PowerShell Universal server and require PSBlazor pages to be created. They are still interactive and customizable but sacrifice some flexibility for simplicity.

Both apps and tools can call APIs and scripts within PowerShell Universal using the built-in Universal module.

Last updated

Copyright 2022 Ironman Software