Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Scheduled task fails on script (but script is working fine)

$
0
0

Hi,

I want to run a script via scheduled task. It runs fine when ran in Powershell (ISE).
When ran in scheduled task, it pops up a Powershell but then directly stops. No output at all. Have inserted a try catch which  would send an email with error (which works fine when not launched in scheduled task) but no email.

Have scheduled a similar script with same settings (same user, same priviliges, same trigger) and that runs fine.

My script also runs fine when I copy paste what's in the scheduled taks = powershell.exe -file 'E:\Scripts\MyScript.ps1'

Please advise howto troubleshoot.
J.


Jan Hoedt


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>