I scheduled this task below and when I click run in Task Scheduler it doesn't throw any errors but the script doesn't execute: Program:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command "& S:\Scripts\Download-USPTO-Forms.ps1 -destinationFolder 'S:\Scripts\USPTO Forms'"
When I open Run.exe and run this cmd then the Powershell window opens and the script executes:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command "& S:\Scripts\Download-USPTO-Forms.ps1 -destinationFolder 'S:\Scripts\USPTO Forms'"
Why is that? Any ideas? The task seems to be scheduled correctly.
Why are you using the call operator?
powershell -File "S:\Scripts\Download-USPTO-Forms.ps1" -destinationFolder "S:\Scripts\USPTO Forms"
Furthermore, ensure the task has properly mapped drives and permissions.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.