Looking to streamline your automations? In this week’s episode, we walk through how to set up the PowerShell Interpreter in Rewst, giving your scripts more flexibility and control.
Step by Step:
- Confirm the Microsoft Cloud integration bundle is enabled in Rewst.
- Select Exchange Online and Azure, then click Next.
- Choose the Rewst Microsoft Cloud Connector and review the permissions being applied.
- Click Authorize, select a Global Admin account, and accept the permissions.
- If Azure authorization errors appear, reauthorize until Graph, Exchange, and Azure all show as authorized.
- Navigate to Tools and then Interpreters.
- Under PowerShell, refresh the page if Azure initially shows as not installed until the configuration form appears.
- Review the Azure objects that were created, including the Rewst Microsoft Cloud Connector and its assigned permissions.
- Select the Azure subscription you want to use and prepare to assign or create a resource group.
- In Azure, go to Resource Groups and create a new group dedicated to the PowerShell interpreter.
- Name the resource group and choose a region, then review and create it.
- Return to Rewst, refresh subscriptions and resource groups, and select the newly created resource group.
- Click Deploy and allow time for the backend resources to be created.
- In Azure, verify that the deployment created a storage account, function app, application insights, and an app service plan.
- Open the Function App and review the webhook code used by Rewst to process interpreter requests.
- Return to Rewst and open the Live Editor.
- Switch the interpreter to PowerShell and provide test JSON input data.
- Access input values using the ctx object and confirm the PowerShell output returns the expected result.
- Navigate to Automations → Workflows and create a new workflow for testing.
- Add an action to retrieve a company from ConnectWise PSA.
- Add a Debug on Success action.
- In the debug text field, start with #ps to indicate PowerShell execution.
- Reference workflow variables using ctx.variable.path syntax and return the desired value.
- Run the workflow and verify the output matches the expected PowerShell result.
- Confirm the PowerShell interpreter is now functional in both the live editor and workflows.