Scheduled task run a PowerShell script

Windows Server 2019Windows Server 2022Windows Server 2025

To run a PowerShell script using a scheduled task in Windows, you must set the Action to run a Program and configure it as below:

1 Program / Script: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
2 Add arguments (optional) : -file folder_and_file.ps1

Romain Drouche
System Architect | MCSE: Core Infrastructure
IT infrastructure expert with over 15 years of field experience. Currently a Systems and Networks Project Manager and Information Systems Security (ISS) expert, I use my expertise to ensure the reliability and security of technological environments.

Leave a Comment