Offer to wipe the PC at the end of a run #3
Loading…
Reference in a new issue
No description provided.
Delete branch "wipe-prompt"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
At the end of a run the script can now wipe the PC (Windows "Remove everything + clean the drive"), with time to pull the USB stick first. Version 2026.11.04.3.
Nothing is wiped unless all of these hold, in order:
y, a wrong ID or no input all skip.reagentc /info).Write-VolumeCache; failure aborts), then the stick must actually be removed. Any key or 5 minutes cancels.Then a one-shot SYSTEM scheduled task (no trigger, unique name, deleted afterwards) calls MDM RemoteWipe
doWipeProtectedMethod, loggingINVOKING/ACCEPTED/REJECTED/UNKNOWN. Only an explicit rejection opens Settings > Recovery for a manual reset. A timeout or any error after the task starts reports "unknown, do not run again". Windows Home skips the task and opens the Settings reset.README: new "Wiping a PC" section, including that rerunning on an already-inventoried PC keeps its asset ID.
Tests (macOS pwsh 7, script functions loaded with Windows cmdlets stubbed): parse OK; 17 skip/cancel/failure paths create and start no task; Home opens only the manual route; task start failure gives UNKNOWN with no manual fallback; positive control creates and starts the task; generated SYSTEM payload parses. Not yet run on real Windows / PowerShell 5.1. The first real test is the rerun on the first PC.
Review-gate: gpt-6.1-sol fix-then-ship (Codex), plan and diff. Plan findings all applied (see commit
7d03d2a). Diff blockers fixed in7547c5f: keys waiting in the buffer now cancel instead of being discarded; errors afterStart-ScheduledTaskare UNKNOWN, not REJECTED, so the manual reset never opens while a wipe may be running. Nit left: a missing RemoteWipe return value counts as accepted (no fallback either way).🤖 Generated with Claude Code