Compare commits

..

2 Commits

Author SHA1 Message Date
MyDrift
43847aba17
Merge 1678663f46 into 28bea518f0 2024-12-28 23:31:29 +01:00
DeveloperDurp
28bea518f0
Add exception catch for Unauthorized Access (#3114) 2024-12-28 15:38:40 -06:00

View File

@ -47,6 +47,8 @@ function Set-WinUtilRegistry {
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
} catch [System.Management.Automation.ItemNotFoundException] {
Write-Warning $psitem.Exception.ErrorRecord
} catch [System.UnauthorizedAccessException]{
Write-Warning $psitem.Exception.Message
} catch {
Write-Warning "Unable to set $Name due to unhandled exception"
Write-Warning $psitem.Exception.StackTrace