Summary
scripts/powershell/setup-plan.ps1 captures extra positional arguments via ValueFromRemainingArguments but never validates them, so a misspelled or unsupported option is silently ignored and the script reports success. Its sibling setup-tasks.ps1 rejects the same input.
The inconsistency
scripts/powershell/setup-plan.ps1 captures but never checks:
# Capture extra positional arguments to match Bash/Python behavior.
[Parameter(ValueFromRemainingArguments = $true)]
[string[]]$RemainingArgs
)
scripts/powershell/setup-tasks.ps1:20-23 does check:
if ($RemainingArgs.Count -gt 0) {
[Console]::Error.WriteLine("ERROR: Unknown option '$($RemainingArgs[0])'")
exit 1
}
Impact
In automation, ./setup-plan.ps1 -Jsonn (or any unsupported positional) proceeds as though no option were passed, creates or reports a plan, and exits 0. The invocation error is masked rather than surfaced — the failure mode setup-tasks.ps1 was explicitly changed to prevent.
Suggested fix
Mirror setup-tasks.ps1: validate after help handling and before any filesystem work, so -Help still wins and exits 0 consistently with the Bash/Python variants.
if ($Help) { ...; exit 0 }
if ($RemainingArgs.Count -gt 0) {
[Console]::Error.WriteLine("ERROR: Unknown option '$($RemainingArgs[0])'")
exit 1
}
Worth checking the other scripts/powershell/*.ps1 entry points for the same gap — this looks like validation added to setup-tasks.ps1 that wasn't propagated to its siblings.
Version
Reproduced on main @ c0fe0e4 (v0.14.2).
Found by an automated review pass over a vendored copy in a downstream project; verified against upstream main before filing.
Summary
scripts/powershell/setup-plan.ps1captures extra positional arguments viaValueFromRemainingArgumentsbut never validates them, so a misspelled or unsupported option is silently ignored and the script reports success. Its siblingsetup-tasks.ps1rejects the same input.The inconsistency
scripts/powershell/setup-plan.ps1captures but never checks:scripts/powershell/setup-tasks.ps1:20-23does check:Impact
In automation,
./setup-plan.ps1 -Jsonn(or any unsupported positional) proceeds as though no option were passed, creates or reports a plan, and exits0. The invocation error is masked rather than surfaced — the failure modesetup-tasks.ps1was explicitly changed to prevent.Suggested fix
Mirror
setup-tasks.ps1: validate after help handling and before any filesystem work, so-Helpstill wins and exits0consistently with the Bash/Python variants.Worth checking the other
scripts/powershell/*.ps1entry points for the same gap — this looks like validation added tosetup-tasks.ps1that wasn't propagated to its siblings.Version
Reproduced on
main@c0fe0e4(v0.14.2).Found by an automated review pass over a vendored copy in a downstream project; verified against upstream
mainbefore filing.