This blog is about how to automate the Powershell scripts (.ps1 Files) using Task Scheduler.
Create Job Scheduler
- Task Scheduler - Create a Task - “Task Name”
- Once the task is created we need to schedule the job for the specified intervals Trigger Tab - New
Configuration of Task details
Execute Action
- After specifying the Intervals when the job needs to be run, provide the input file path of the Powershell File.
- Actions Tab - New
- Program/ Script - Powershell.exe (Applicable Only If your input file is powershell (.ps1 file)
- Add Arguments (Optional): -ExecutionPolicy Bypass “Path of the PowerShell file"
Configurations - Conditions
- Common options for the power job:
Run – Scheduled Job
- Once we created the Job with the above configurations, we need to run the job. The first time it will execute again and again based on the intervals which we created.