Unable to run Task Scheduler Automation

Mark Bovenzi 60 Reputation points
2024-02-29T20:59:06.98+00:00

I am trying to run automation using Task Scheduler on my Windows Server 2019 which is my SQL server. I have created a Windows PowerShell script that calls to an external Azure site to grab a file and store it locally. In my script, I need to run a command to execute the task. Unfortunately, when setting up Task Scheduler to have this run automatically, it is failing with the directory name is invalid. User's image

Program/Script - Points to PowerShell - C:\Windows\System32\WindowsPowerShell\v1.0\powershell_ise.exe Add Arguments points to the command you need to run once the script it open Start in points to my .ps1 script User's image

When I run it, I get: Task Scheduler failed to launch action "C:\Windows\System32\WindowsPowerShell\v1.0\powershell_ise.exe" in instance "{97f26cda-8700-4dc2-93ee-f3df8823962f}" of task "\UAT Backup". Additional Data: Error Value: 2147942667.

Windows for business Windows Server User experience PowerShell
0 comments No comments
{count} votes

Accepted answer
  1. Michael Taylor 60,161 Reputation points
    2024-02-29T21:29:39.0833333+00:00

    Powershell ISE is the scripting editor you use to edit PS files and debug them, not run scripts.

    Try using C:\windows\system32\windowspowershell\v1.0\powershell.exe instead.


1 additional answer

Sort by: Most helpful
  1. Mark Bovenzi 60 Reputation points
    2024-03-01T19:48:48.6866667+00:00

    editing out file


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.