mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-01-02 02:54:55 -06:00
Add exception catch for Unauthorized Access (#3114)
This commit is contained in:
parent
61c2e39ddb
commit
28bea518f0
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user