Skip to content

Instantly share code, notes, and snippets.

@magnushammar
Last active December 5, 2019 14:38
Show Gist options
  • Save magnushammar/8cab447e4f7b986ef956289e96546575 to your computer and use it in GitHub Desktop.
Save magnushammar/8cab447e4f7b986ef956289e96546575 to your computer and use it in GitHub Desktop.
$registryPath = "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\SystemRestore"
$name = "SystemRestorePointCreationFrequency"
$value = "0"
(IF(!(Test-Path $registryPath))
{
New-Item -Path $registryPath -Force | Out-Null
New-ItemProperty -Path $registryPath -Name $name -Value $value ` -PropertyType DWORD -Force | Out-Null}
ELSE {
New-ItemProperty -Path $registryPath -Name $name -Value $value ` -PropertyType DWORD -Force | Out-Null})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment