1 Commits

Author SHA256 Message Date
Alphaeus Mote 1ef7d348d8 feat(scripts): read PowerShell param() blocks and check values on every start
The server reads a PowerShell script's param() block with PowerShell's own
parser (System.Management.Automation, parse only) through
POST /api/scripts/parameters/parse (scripts.view) and merges it into the
editor's parameters: the code owns name, type, required, default and
ValidateSet; Expansion and hand-written descriptions without help are kept;
parameters gone from the code are dropped. Only constant primitive defaults
and lists of them are imported; computed ones stay in the code. `using
assembly` is masked before parsing, since the parser would load it.

Manual runs, trigger saves and every firing share one check: a required
parameter needs a value or a default, and given values must fit. Schedules
store only the values set on them, so untouched ones follow the script's
defaults; a firing that no longer fits records why and does not run. Empty
values count as not given on the server and the agent alike.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 20:46:00 -05:00