A desktop state recovery script looks like simple file movement, but the important parts are timing, backup, reversible evidence, and protection against mistakes.
Project Overview
The PowerShell script has parameter handling, path normalization, detached execution, process waiting, backup directories, copy and move records, summary.json, and DryRun.
The script restores state files after the desktop app exits and leaves a structured record. It fits state migration, recovery rehearsal, and checking target directories before batch operations.
Execution Model
The script waits for the target process to exit, creates a timestamped backup directory, copies the current state there, moves the new database file into place, and records every step in a JSON summary.
DryRun only emits the planned actions and checks. Tests use temporary state directories to verify both dry-run and real execution.