Forum Discussion

GaryHenry-4285's avatar
GaryHenry-4285
Copper Contributor
Feb 27, 2026

Powershell runs fine manually but not in Task Scheduler

I have a strange problem, and I am hoping someone will be able to point me to a solution.

Below you will see a PowerShell script below that I am running 

The script works fine when it is run manually in PowerShell, but when I put it in the Windows Task Scheduler and it runs at the appointed time (5 am) the output is garbage

You can see the script running below at 5am

If it Right click on the task in the scheduler, and tell it to run, the script it runs normally and the output is fine

I am guessing there is some switch or something that I am missing that will need to make this work, but I am hoping someone has an idea and can help me because I am lost

Thanks

Gary

 

No RepliesBe the first to reply