Run a PowerShell script locally for Worklets with Automox parameters
When testing a PowerShell script on a local device, running it with the same parameters that Automox uses will help validate the script for worklet use. Automox uses 32-bit and runs as the System account.
Requirements
- Download PsTools from Microsoft:
-
https://docs.microsoft.com/en-us/sysinternals/downloads/psexec
- Extract the files and add them to the System32 folder
-
- Use psexec to run as the local System account:
psexec -s SCRIPT_GOES_HERE
- psexec requires that an End-User License Agreement be accepted on first use. This can be done with the following command:
psexec -accepteula
- psexec requires that an End-User License Agreement be accepted on first use. This can be done with the following command:
- When testing scripts, ensure that you are running the 32-bit version of PowerShell with either:
- Windows PowerShell (x86)
- Windows PowerShell ISE (x86)