Reboot computer after preparation

This commit is contained in:
Manuel Thalmann 2023-06-29 02:24:46 +02:00
parent bc30ac9902
commit 29fa937e5f

View file

@ -95,7 +95,8 @@ function Enable-UACNextLogin([Context] $context) {
". `"$PSScriptRoot/../Scripts/Context.ps1`";", ". `"$PSScriptRoot/../Scripts/Context.ps1`";",
"`$context = [Context]::new();", "`$context = [Context]::new();",
"`$context.EntryPoint = `"$($context.EntryPoint)`";", "`$context.EntryPoint = `"$($context.EntryPoint)`";",
"`$context.RegisterReboot((Get-Item `"Registry::HKEY_USERS\$((Get-LocalUser $context.UserName).SID)))"))); "`$context.RegisterReboot((Get-Item `"Registry::HKEY_USERS\$((Get-LocalUser $context.UserName).SID)));",
"Restart-Computer;")));
$trigger = New-ScheduledTaskTrigger -AtLogOn; $trigger = New-ScheduledTaskTrigger -AtLogOn;
$principal = New-ScheduledTaskPrincipal -UserId "SYSTEM" -RunLevel Highest; $principal = New-ScheduledTaskPrincipal -UserId "SYSTEM" -RunLevel Highest;