So I have ps1 consist of executing .bat file to gather data and output via email.
If I were to run ps1 manually everything works just fine. When it comes to task scheduling, only my headers shows up in my csv file.
Hope my action is correct.
Program/script: powershell
Add arguments: -Executionpolicy Bypass -file “D:\ScheduledTasks\file1.ps1”
Ok, so it worked just like the other form.
it’s the output i’m questioning.
Why my output from Task Scheduler not the same as if I manually run the script?
Ok, so I added myself to “Security options: When running the task, use the following user account:”
This is account I ran script manually. Still empty.