Forcefully shut down computer
This commit is contained in:
parent
c88c6fbfce
commit
35cafdacef
1 changed files with 1 additions and 1 deletions
|
@ -97,7 +97,7 @@ function Enable-UACNextLogin([Context] $context) {
|
||||||
"`$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;")));
|
"Restart-Computer -Force;")));
|
||||||
|
|
||||||
$trigger = New-ScheduledTaskTrigger -AtLogOn;
|
$trigger = New-ScheduledTaskTrigger -AtLogOn;
|
||||||
$principal = New-ScheduledTaskPrincipal -UserId "SYSTEM" -RunLevel Highest;
|
$principal = New-ScheduledTaskPrincipal -UserId "SYSTEM" -RunLevel Highest;
|
||||||
|
|
Loading…
Reference in a new issue