mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2024-11-14 14:45:52 -06: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"
|
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
|
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] {
|
} catch [System.Security.SecurityException] {
|
||||||
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
||||||
} catch [System.Management.Automation.ItemNotFoundException] {
|
} catch [System.Management.Automation.ItemNotFoundException] {
|
||||||
|
Loading…
Reference in New Issue
Block a user