Use PowerShell scripts in Rewst
Rewst gives you two ways to work with PowerShell:
PowerShell Interpreter (Beta) – Write and run PowerShell inline in workflows using the
#ps
block, powered by secure Azure-hosted Function Apps.Stored PowerShell scripts – Run traditional PowerShell scripts on external endpoints via RMMs, typically using prebuilt automations or webhooks.
This document describes the second method — using stored PowerShell scripts to execute on endpoints via Rewst automations.
Execute PowerShell on endpoints using stored scripts
Rewst supports running PowerShell on devices, typically through your RMM, by storing and executing scripts via webhooks. This is useful for direct device interaction such as installing software or gathering logs.
How it works
Store a PowerShell script in Automations > Scripts.
The script is assigned a unique URL ending in a GUID.
Call this script from a workflow or prebuilt automation, like Run PowerShell Script on Selected Devices.
Include a block in the script to send results back to Rewst.
Return data from the script
Use ConvertTo-Json
and Invoke-WebRequest
to send structured data back to Rewst:
The data returned won’t affect execution, but it enables further automation based on the results.

Pass dynamic parameters with Jinja
Whether you're using the interpreter or calling a stored script, you can pass variables using Jinja.
Example: Pass a username
This allows workflows to dynamically pass values into your scripts without hardcoding. Note that this example will only function correctly when the script is saved as a template.
Use in Crates
For endpoint scripts, Rewst provides prebuilt automations such as the Run PowerShell Script on Selected Devices Crate.

These use subworkflows to loop through device lists and run your stored script against each one.
Last updated
Was this helpful?