Fix incorrect order of commands

This commit is contained in:
Manuel Thalmann 2023-07-03 13:43:58 +02:00
parent d96a1bf913
commit 98dfa910be

View file

@ -110,10 +110,10 @@ function Enable-UACNextLogin([Context] $context) {
"Set-ItemProperty '$($key.PSPath)' -Name 'EnableLUA' -Value 0 -Type DWord;", "Set-ItemProperty '$($key.PSPath)' -Name 'EnableLUA' -Value 0 -Type DWord;",
"Unregister-ScheduledTask -Confirm:`$false '$autoLoginName';", "Unregister-ScheduledTask -Confirm:`$false '$autoLoginName';",
"Unregister-ScheduledTask -Confirm:`$false '$uacDisablerName';", "Unregister-ScheduledTask -Confirm:`$false '$uacDisablerName';",
"`$context.Remove('$autoLoginTriggerProperty');",
"`$context.Remove('$uacDisablerTriggerProperty');",
". '$PSScriptRoot/../Scripts/Context.ps1';", ". '$PSScriptRoot/../Scripts/Context.ps1';",
"`$context = [Context]::new();", "`$context = [Context]::new();",
"`$context.Remove('$autoLoginTriggerProperty');",
"`$context.Remove('$uacDisablerTriggerProperty');",
"`$context.DeregisterNewUserReboot();", "`$context.DeregisterNewUserReboot();",
"Restart-Computer -Force;"))); "Restart-Computer -Force;")));