Add missing argument to SchTasks
This commit is contained in:
parent
cba6e514bb
commit
858679a36a
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue