PowerShell Script Doesn’t Finish In Task Scheduler

IT Support Forum Forums Windows Windows 10 Troubleshooting PowerShell Script Doesn’t Finish In Task Scheduler

Viewing 0 reply threads
  • Author
    • #2449

      Fixed: When running a PowerShell script in the IDE it finishes fine, but when I run the same PowerShell script via the Task Scheduler the task never finishes.

      To fix this, instead run a batch file that calls the PowerShell script thusly:

      Powershell.exe -executionpolicy remotesigned -File C:\script.ps1

      The task should then finish without issue, though I don’t know why it does this because the script itself doesn’t seem to need elevating as it seems to run (but not finish) as a PowerShell script.

      Other sources on the internet mention fixing the problem by ticking the box in Task Scheduler to Run With Highest Privileges, though I didn’t have any luck with that option.

Viewing 0 reply threads
  • You must be logged in to reply to this topic.