I am trying to invoke a power shell script using task scheduler but it gives me the error, The directory name is invalid Error (0x8007010B).
I have tried placing the script in C: and C:\users and also D: But the error remains.
I have tried adding and removing the quotes in the location specification but the issue remains the same. image1
Here are the arguments and the exact directory path of the PowerShell script to be run.
Add arguments: -ExecutionPolicy Bypass -File
Start in: D:\automationscripts\RestartTomcat.ps1
Permissions of the directory:image2
Here is the update after changing the parameters of the Arguments and Start in Update1
Ok, this is just a scheduled task syntax issue. You need the file name in your arguments, and the Start In to just be the folder location. So your action would be:
Program: PowerShell.exe
Arguments: -ExecutionPolicy Bypass -File RestartTomcat.ps1
Start in: D:\automationscripts