Using Avalonia UI in DeployR Task Sequences

Lately, I’ve been doing some testing with Avalonia UI and PowerShell in DeployR, and one of the things I wanted to try was a simple dialog for entering a computer name during a task sequence. The result is a PowerShell script that dynamically creates an Avalonia form and returns the computer name entered by the user.

What makes this particularly useful with DeployR is that the script can be embedded directly into the task sequence. WPF-based PowerShell frontend scripts don’t work the same way in DeployR. They need to be added as a content item, or to the boot image, and then executed using pwsh.exe (PowerShell 7). For something as simple as a computer name prompt, having the entire script directly in the task sequence is quite handy.

Sample Avalonia Frontend in Windows PE
Sample Avalonia Frontend in a Linux boot image

DeployR 1.3 Requirements

If you’re using DeployR 1.3, the following two Avalonia files need to be copied to the DeployR Client folder (default C:\Program Files\2Pint Software\DeployR\Client). Here is a script that does that for you: https://github.com/DeploymentResearch/DRFiles/blob/master/Scripts/DeployR/Download-AvaloniaLoader.ps1

  • Avalonia.Markup.Xaml.Loader.dll
  • Avalonia.Markup.Xaml.Loader.xml

After adding the files, restart the DeployR Service so the DeployR client Windows x64 content item gets updated, then regenerate the Windows PE x64 boot mage. This is just a temporary solution for DeployR 1.3, these files will be included by default with the upcoming DeployR 1.4 version.

Why Avalonia?

WPF has been the standard choice for building PowerShell GUIs on Windows for a very long time, and I’ve written plenty of WPF-based deployment tools myself. That said, Avalonia has a few things going for it.

First, Avalonia is cross-platform. WPF is Windows-only, while Avalonia supports Windows, Linux, and macOS. Obviously DeployR is primarily being used to deploy Windows today, but there has been an uptick in customers using DeployR to deploy Linux as well. I've only deployed Ubuntu with DeployR, but there is support for Fedora, and RedHat Enterprise Linux (RHEL).

Avalonia is also based on modern .NET and will feel fairly familiar if you’ve worked with WPF. It uses the same general concepts around controls, layouts, XAML, bindings, and so on.

And, at least for this particular DeployR scenario, as mentioned earlier: the Avalonia PowerShell code works directly as an embedded task sequence script.

Adding the Sample Avalonia Frontend

The sample is intentionally an easy one. It displays a dialog asking for a computer name and then makes that value available to the task sequence. But the same approach could easily be used for other deployment-time questions, such as selecting a location, department, deployment type, or applications.

To add the frontend, simply access or download the script, and paste it into a Run Powershell script step in the task sequence

The frontend: https://github.com/DeploymentResearch/DRFiles/blob/master/Scripts/DeployR/SampleAvaloniaFrontend.ps1

Sample
About the author

Johan Arwidmark

5 2 votes
Article Rating
Subscribe
Notify of
guest
4 Comments
Newest
Oldest Most Voted
Kelly Smith
Kelly Smith
23 days ago

2026-09-14 17:42:54.702 [error] PowerShell does not support debugging this language mode: 'Log'.
I have enough issues with normal powershell. I'm not sure how this is gonna work…

Kelly S
Kelly S
1 month ago

What else can be done with it? Garys seems to work, would this be compatible in VS code to modify as well?.


>