-1

I have a .ps1 file that works when I run it in PowerShell (it registers a filesystemwatcher to watch for changes in an excel file), but I can't get it to work when I schedule it in task scheduler.

Is this because my inputs are off or do I need to export this .ps1 into something else?

My inputs-

Program = PowerShell.exe

Add arguments = -ExecutionPolicy Bypass \blah blah blah\testing file.ps1

Start in is empty

Ian Kemp
  • 28,293
  • 19
  • 112
  • 138
Jeff T.
  • 11
  • 6

1 Answers1

1

Try this:

Action: Start a program

Program: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

Arguments: -ExecutionPolicy Bypass -file "\blah blah blah\testing file.ps1"

Danfossi
  • 171
  • 1
  • 2
  • 13