diff --git a/cleanW10.ps1 b/cleanW10.ps1 index a5397c1..b4e40ef 100755 --- a/cleanW10.ps1 +++ b/cleanW10.ps1 @@ -276,7 +276,15 @@ function DelRegKey { return } try { - Remove-ItemProperty -Path $params.path -Name $params.key + Get-ItemProperty -Path $params.path -Name $params.key + } + catch { + Write-Host -ForegroundColor Yellow "key already deleted" + return + } + try { + + #Remove-ItemProperty -Path $params.path -Name $params.key Write-host -ForegroundColor Green "done" } catch [System.Security.SecurityException]{