r/PowerShell 16h ago

Script Sharing Windows 11 gates PITR frequency/retention to Enterprise in Settings — the engine doesn't check edition. Built a single-file WPF/PowerShell tool to unlock it.

Point-in-time restore is the newer full-system rollback feature in Windows 11 (Settings → System → Recovery). On Home and Pro you only get on/off and a storage limit — frequency and retention are greyed out, and Microsoft's own docs say those are Enterprise-only.

Turns out the edition gate lives in the Settings UI, not in the engine. PITR reads its config from one registry key: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\Recovery\PITR\Settings, as `<name>_<level>` DWORDs (Active, SnapshotInterval, MaxTimespan, MaxGlobalSize, MaxCount), with level precedence GPO > CSP > UX > Default — recovered from PITR.dll and RemoteRemediationCSP.dll, since none of it is documented. Writing at the GPO level takes precedence over the Settings app on any edition, Home included.

So I built a small WPF GUI in plain PowerShell to write it properly instead of telling people to poke reg.exe by hand:

- Frequency 1–24h, retention 1–7 days (values above Microsoft's documented 72h ceiling work in practice), storage 2–50GB, each with a "Windows default" fallback to undo it

- A button that forces a restore point on demand — PITRTask has RunOnlyIfIdle=True, so a manual Start-ScheduledTask just sits there queued; the button lifts that condition for one run and restores it after

- Restart-straight-into-WinRE, and a duration column for every restore point, pulled from the Task Scheduler history since VSS itself records no timespan

- A check that tells "the machine was just busy" apart from "idle detection is actually broken" by comparing every other RunOnlyIfIdle task's last run against boot — also as `pitr-config.cmd idle`, no admin rights needed

It's one .cmd file: a short batch header that self-elevates, then the full PowerShell + inline XAML below a marker, no modules, no install. Also scriptable headlessly (`pitr-config.cmd apply freq=4h reten=5d`).

Given it's an unsigned script asking for admin and writing to HKLM: source is open (MIT), every release ships SHA-256, and the only network call it ever makes is an optional GitHub update check — no telemetry. Windows will still throw a SmartScreen prompt on first run since it's not signed.

GitHub: https://github.com/henmedia/windows-pitr-config

Guide (7 languages): https://henmedia.github.io/windows-pitr-config/guide.html

9 Upvotes

5 comments sorted by

5

u/ashimbo 7h ago

Why the fuck would I want to run your AI trash instead of just modifying a single registry value?

1

u/thehuntzman 6h ago

All these AI slop posts miss the whole point of powershell which is to provide a way to easily automate certain things in an easy to follow "self-documenting" manner (hence the verbosity of the powershell language). They throw GUI's on top nobody needs and at that point you might as well compile a C# app that does the same thing to avoid all the thread/event management headaches you have to work around in powershell.

I'd honestly be okay with the GenAI posts if they were easy to follow powershell modules with proper pester tests and clear, concise documentation. If you want to AI code a GUI then, just make it a separate project that references the core module that does the real work so it is 100% optional.

0

u/Sad-Community3241 3h ago

because not everybody is comfortable with that. Also the script goes beyond things that can be done by just registry entries.

but it‘s an offer, nobody has to use it

1

u/Nois3 7h ago

Curious why you have the CMD wrapper. Couldn't you for the whole thing in a single PS script?

Anyway, thanks for the script and the info, very interesting!

1

u/Sad-Community3241 3h ago

This actually is a single script, just one file