From 858679a36aaa0e1774dc3856920ce59929dabf34 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Thu, 29 Jun 2023 14:22:21 +0200 Subject: [PATCH] Add missing argument to `SchTasks` --- scripts/Windows/OS/User.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Windows/OS/User.ps1 b/scripts/Windows/OS/User.ps1 index 588c2fbb..289d3471 100644 --- a/scripts/Windows/OS/User.ps1 +++ b/scripts/Windows/OS/User.ps1 @@ -103,7 +103,7 @@ function Enable-UACNextLogin([Context] $context) { "`$context.RegisterReboot((Get-Item 'Registry::HKEY_USERS\$((Get-LocalUser $context.UserName).SID)'));", "Restart-Computer -Force;"))); - schtasks /Create /SC ONEVENT /MO "*[System[Provider[@Name='Application'] and EventID=$taskTrigger]]" /TR cmd.exe /TN "$tempTask"; + schtasks /Create /SC ONEVENT /EC Application /MO "*[System[Provider[@Name='Application'] and EventID=$taskTrigger]]" /TR cmd.exe /TN "$tempTask"; $trigger = (Get-ScheduledTask $tempTask).Triggers; $principal = New-ScheduledTaskPrincipal -UserId "SYSTEM" -RunLevel Highest; $task = New-ScheduledTask -Action $action -Principal $principal -Trigger $trigger;