Running A PowerShell CmdLet As A Scheduled Task

IT Support Forum Forums Windows Windows Server 2012 General Discussion Running A PowerShell CmdLet As A Scheduled Task

This topic contains 0 replies, has 1 voice, and was last updated by  Webmaster 9 months, 4 weeks ago.

  • Author
    Posts
  • #1708

    Webmaster
    Keymaster

    Running a PowerShell cmdlet as a scheduled task is different to running a bat file. If you don’t follow this method, your PowerShell script will error with code 0x1 or run forever.

    To schedule a PowerShell script to run, you have to have the program / script set to run “PowerShell”, then specify the folder location of the ps1 file in the “Start In” box, then put the name of the script as an argument, in the format .\scriptname.ps1.

    If you have any issues running your PowerShell cmdlet as a scheduled task, drop a message in the forum and I’ll try to help you 🙂

You must be logged in to reply to this topic.