mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2024-11-24 11:55:31 +00:00
Add logic to remove Registry Keys via Tweaks (#2837)
This commit is contained in:
parent
0deac4ebb2
commit
d855b08119
@ -36,7 +36,12 @@ function Set-WinUtilRegistry {
|
||||
}
|
||||
|
||||
Write-Host "Set $Path\$Name to $Value"
|
||||
if ($Value -ne "<RemoveEntry>"){
|
||||
Set-ItemProperty -Path $Path -Name $Name -Type $Type -Value $Value -Force -ErrorAction Stop | Out-Null
|
||||
}
|
||||
else{
|
||||
Remove-ItemProperty -Path $Path -Name $Name -Force -ErrorAction Stop | Out-Null
|
||||
}
|
||||
} catch [System.Security.SecurityException] {
|
||||
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
||||
} catch [System.Management.Automation.ItemNotFoundException] {
|
||||
|
Loading…
Reference in New Issue
Block a user