diff --git a/scripts/Windows/OS/User.ps1 b/scripts/Windows/OS/User.ps1 index 02b59d51..71374bab 100644 --- a/scripts/Windows/OS/User.ps1 +++ b/scripts/Windows/OS/User.ps1 @@ -101,6 +101,7 @@ function Enable-UACNextLogin([Context] $context) { "`$username = `$context.Get('$preparedUsernameProperty');", "`$password = `$context.Get('$preparedPasswordProperty');", "`$context.SetAutologin(`$username, `$password);", + "`$context.Remove('$preparedUsernameProperty');", "`$context.Remove('$preparedPasswordProperty');")), [System.Tuple]::Create( $uacDisablerTrigger, @@ -109,6 +110,8 @@ function Enable-UACNextLogin([Context] $context) { "Set-ItemProperty '$($key.PSPath)' -Name 'EnableLUA' -Value 0 -Type DWord;", "Unregister-ScheduledTask -Confirm:`$false '$autoLoginName';", "Unregister-ScheduledTask -Confirm:`$false '$uacDisablerName';", + "`$context.Remove('$autoLoginTriggerProperty');", + "`$context.Remove('$uacDisablerTriggerProperty');", ". '$PSScriptRoot/../Scripts/Context.ps1';", "`$context = [Context]::new();", "`$context.DeregisterNewUserReboot();",