Skip to content

Commit

Permalink
readme: update
Browse files Browse the repository at this point in the history
  • Loading branch information
Tatsh committed Oct 8, 2023
1 parent b04208e commit 30ccef6
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,24 @@ path2reg HKCU:
path. `reg` command output is escaped for Batch file only. No variables will be present in the
output. If you want to use a `reg` command in PowerShell you need to replace `%%` with `%`.

## Automated Usage

You can create a scheduled task that will run every 12 hours to backup a registry path.
`Register-SavePreferencesScheduledTask` (`winprefs-install-job`) can be called multiple times with
different `-Path` arguments. Like `Save-Preferences` it can automatically commit to a repository and
push. Because it uses a PowerShell script, `Execution-Policy` must be changed to `Bypass`:

```powershell
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser
```

Calling `Register-SavePreferencesScheduledTask` multiple times with the same `-Path` argument will
not break anything. If a task with the same name already exists, it must be unregistered before its
replacement can be made.

Any task can be uninstalled with `Unregister-SavePreferencesScheduledTask` (`winprefs-uninstall-job`)
with the same `-Path` argument.

### Examples

#### Save `HKEY_LOCAL_MACHINE\Control Panel` with a depth of 1
Expand Down

0 comments on commit 30ccef6

Please sign in to comment.