Automate PowerShell Job

This blog is about how to automate the Powershell scripts (.ps1 Files) using Task Scheduler. 

Create Job Scheduler
  1. Task Scheduler - Create a Task - “Task Name”

    Powershell

    Powershell

  2. Once the task is created we need to schedule the job for the specified intervals Trigger Tab - New

    Powershell
    Configuration of Task details

    Powershell
    Execute Action

  3. 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"

      Powershell

      Powershell
      Configurations - Conditions

  4. Common options for the power job:

    Powershell

    Powershell
    Run – Scheduled Job

  5. 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.

    Powershell