Compare commits

..

2 Commits

Author SHA1 Message Date
Chris Titus
4b72d15c41
Merge 623e6013bf into 28bea518f0 2024-12-28 15:41:33 -06: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