Forcefully shut down computer

This commit is contained in:
Manuel Thalmann 2023-06-29 02:57:10 +02:00
parent c88c6fbfce
commit 35cafdacef

View file

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