Get Started
Get started with PowerShell Universal

Install PowerShell Universal

You'll need to install the PowerShell Universal server. There are a lot of ways to do so but you can use the command line below to get started quickly.
Windows
Linux
Mac OS X
Raspberry PI OS
You can install PowerShell Universal as a service. Ensure that PowerShell is running as administrator or the service won't install correctly.
1
Install-Module Universal
2
Install-PSUServer
Copied!
You can install PowerShell Universal using the following shell script.
1
Install-Module Universal
2
Install-PSUServer
Copied!
You can install PowerShell Universal using the Universal PowerShell module.
1
Install-Module Universal
2
Install-PSUServer -AddToPath
3
Start-PSUServer -Port 5000
Copied!
1
wget https://imsreleases.blob.core.windows.net/universal/production/2.4.0/Universal.linux-arm.2.4.0.zip
2
unzip Universal.linux-arm.2.3.2.zip -d ./PSU
3
chmod +x ./PSU/Universal.Server
4
./PSU/Universal.Server
5
Copied!

Open PowerShell Universal

By default, PowerShell Universal is running on port 5000 of localhost. You can access the admin console with the user name admin and any password.

Create an API

APIs allow you to call PowerShell scripts over HTTP. To create an API, click API \ Endpoints and click Create New Endpoint. Specify a URL.
Next, click details on the API that was created an enter the following command into the editor.
1
Get-ComputerInfo
Copied!
Save the script and then click the Execute button to test it out.
You can also execute the API via Invoke-RestMethod.
1
PS C:\Users\adamr> Invoke-RestMethod http://localhost:5000/hello-world
2
3
WindowsBuildLabEx : 22000.1.amd64fre.co_release.210604-1628
4
WindowsCurrentVersion : 6.3
5
WindowsEditionId : Professional
6
WindowsInstallationType : Client
7
WindowsInstallDateFromRegistry : 8/6/2021 4:05:12 PM
8
WindowsProductId : 00330-52452-93139-AAOEM
9
WindowsProductName : Windows 10 Pro
10
WindowsRegisteredOrganization :
Copied!

Create a Script

To create a script, click Automation \ Scripts and then click Create New Script.
Enter the following script into the editor and save.
1
Read-Host "What should I say?"
2
3
1..100 | ForEach-Object {
4
Write-Progress -PercentComplete $_ -Activity "Processing..."
5
}
6
7
Get-Service
Copied!
Once the script is saved, click Run.

Create a Dashboard

To create a new PowerShell-based user interface (dashboard), you can click User Interfaces \ Dashboard and then Create New Dashboard.
After clicking Ok, click the Details button to edit the PowerShell script. Add the following script to the editor.
1
New-UDDashboard -Title "Hello, World!" -Content {
2
New-UDButton -Text "Click Me" -OnClick {
3
Show-UDToast -Message 'Success!!'
4
}
5
}
Copied!
Save the dashboard, click the Restart button and then click the View button. Click the Click Me button.
Learn more about the various features of PowerShell Universal
Last modified 13d ago