Reboot computer after preparation

This commit is contained in:
Manuel Thalmann 2023-06-29 02:24:46 +02:00
parent 0f203caaa7
commit ecf6b0c573

View file

@ -95,7 +95,8 @@ function Enable-UACNextLogin([Context] $context) {
". `"$PSScriptRoot/../Scripts/Context.ps1`";",
"`$context = [Context]::new();",
"`$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;
$principal = New-ScheduledTaskPrincipal -UserId "SYSTEM" -RunLevel Highest;