Dashboard as a scheduled task

Is it possible to run a poshUD as a scheduled task? I need it to run between specific hours and when I set up a scheduled task for this purpose and link it to the powershell file that creates the dashboard, nothing happens even when the task executes successfully.
When the powershell script is manually run, the dashboard shows up just fine.
Any guidance would be appreciated. Thanks!

The UA job’s process terminates after running. Have you tried to use the -Wait parameter on Start-UDDashboard? That should prevent the job from terminating.

You could also have a scheduled job that runs at a certain time that starts PowerShell.exe with the -File parameter that points to the dashboard.ps1.

Then you could store the Process ID somewhere; file, UA variable etc.

Then you could have another scheduled job that stops the process stored in the variable.

Hi Adam,

“You could also have a scheduled job that runs at a certain time that starts PowerShell.exe with the -File parameter that points to the dashboard.ps1.”

This is exactly what I have been doing, but the task runs successfully and I don’t see the dashboard.

I even tried adding a Start-Sleep command in the ps1 file to get it to stay executing for a while longer, but no luck with that either.

I’ll try the “-Wait” parameter as suggested and share my findings.