Compare commits

...

2 Commits

Author SHA1 Message Date
DeveloperDurp
857f1edf5a
Merge 06e7301b57 into 0dfa9617fc 2024-12-26 16:52:49 -06:00
DeveloperDurp
06e7301b57 Add exception catch for Unauthorized Access 2024-12-18 06:35:11 -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