I can’t understand how to carry out the scheduled task at startup , it is being executed, but only in the background, and not in the interactive mode, although I set the task parameter to interactive:
Register-ScheduledJob -Name runatstartup `
-ScriptBlock { start chrome } `
-Trigger (New-JobTrigger -AtStartup)
Set-ScheduledTask -TaskName runatstartup `
-TaskPath Microsoft\Windows\PowerShell\ScheduledJobs `
-Principal (New-ScheduledTaskPrincipal -Logontype Interactive -Userid $env:USERNAME)
The same team is working normally, the program appear normal, if I replace -atstartupon -atlogonor -once, -daily. Can anyone help me with this?
source
share