PowerShell the site agent can be told to run on an endpoint. A script is stored here once, pinned by digest, and fetched by the agent at push time so the bytes that run are the bytes that were reviewed.
The body is stored here and hashed. At push time the agent downloads it with its own credential and checks the digest before running anything, so the bytes that run are the bytes that were reviewed. The body never travels on the command channel and is deleted from the endpoint after the run.
System is the agent's own service account: no desktop, no mapped drives, no signed-in person's credentials. User runs in the interactive session instead, and only works when somebody is actually signed in.
The working directory for the run. Blank means the agent's staging folder, which is right for a self-contained script. Set it when the script calls a tool installed separately on the endpoint by relative path. If the folder is missing the run fails outright rather than running somewhere unintended.
This is the one worth understanding. PowerShell treats most errors as non-terminating: it writes the error, carries on to the next line, and still exits zero. Because the command's verdict comes from that exit code, Continue means a script can report success having accomplished nothing.
Stop makes the first error end the run, so the verdict means what you would assume it means. It is not the default because it changes how a script behaves: a body that tolerates a failing cleanup, probes with a cmdlet that errors when something is absent, or loops past bad items will start aborting partway through, leaving the endpoint half-configured. Read the script first, then switch it on.
Script output is always written to the agent log on the endpoint. It is sent back to ShopDB only when the run fails, so routine output stays on the machine that produced it. Long output is truncated and marked as such.
In Stop mode the agent adds one line to the top of the script, so an error reported on line N refers to line N-1 of the body shown here.
| Name | Description | Runs in | On error | Body | Digest | Active | |
|---|---|---|---|---|---|---|---|
| {{ s.scriptname }} | {{ s.scriptdescription || '-' }} | {{ s.workingdirectory || 'Agent staging folder' }} | Stop on first error Continue | {{ s.filename }} No body - cannot run | {{ shortdigest(s) }} | {{ s.isactive ? 'Yes' : 'No' }} | |
| No scripts | |||||||