Remove Policies in tweaks.json (#2991)

* remove policies in tweaks.json

* add proper console log
This commit is contained in:
MyDrift
2024-11-07 01:38:35 +01:00
committed by GitHub
parent 0f0d9d0ae3
commit 7a0c40420e
2 changed files with 36 additions and 35 deletions

View File

@ -35,11 +35,12 @@ function Set-WinUtilRegistry {
New-Item -Path $Path -Force -ErrorAction Stop | Out-Null
}
Write-Host "Set $Path\$Name to $Value"
if ($Value -ne "<RemoveEntry>") {
Write-Host "Set $Path\$Name to $Value"
Set-ItemProperty -Path $Path -Name $Name -Type $Type -Value $Value -Force -ErrorAction Stop | Out-Null
}
else{
Write-Host "Remove $Path\$Name"
Remove-ItemProperty -Path $Path -Name $Name -Force -ErrorAction Stop | Out-Null
}
} catch [System.Security.SecurityException] {