Compare commits

..

2 Commits

Author SHA1 Message Date
dependabot[bot]
1050d905d6
Merge 7eaeef4e54 into 28bea518f0 2024-12-29 13:18:46 +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