Invokes a command inside of a scheduled task
This invokes the boxstarter scheduled task.
The task is run in an elevated session using the provided
credentials. If the processes started by the task become idle for
more that the specified timeout, the task will be termiated. All
output and ny errors from the task will be streamed to the calling
The command to run in the task.
The number of seconds after which the task will be terminated if it
becomes idle. The value 0 is an indefinite timeout and 120 is the
The number of seconds after which the task will be terminated whether
it is idle or active.
Invoke-FromTask Install-WindowsUpdate -AcceptEula
This will install Windows Updates in a scheduled task
Invoke-FromTask "DISM /Online /Online /NoRestart /Enable-Feature /Telnet-Client" -IdleTimeout 20
This will use DISM.exe to install the telnet client and will kill
the task if it becomes idle for more that 20 seconds.