Hi, Damian Garbus here and Today I want to show you how to run Powershell script from Task Scheduler. In the post 3 simple examples of use Powershell for Everybody (for you too) I describe how I’m using Powershell on a daily basis. One example is about backup my KeePass file. I don’t run this backup manually. I’m run Powershell script in Task Scheduler . Please, finish this post completely because I have a surprise for you. OK, Let’s start.

3 Steps…

1. Save you script from you want to run

The first step is to save the Powershell script. I recommend one place for all scripts because it will be easier to manage. Now you can copy the script path. You can use for its combination of shift+right mouse button and “Copy file path”.

powershell script in task scheduler

2. Create Task

Launch Task Scheduler console

powershell script in task scheduler

Create Folder for your tasks

powershell script in task scheduler

Right click and choose “Create task…”. Enter the name and description of new Task.

powershell script in task scheduler

It’s time to setup trigger and action

powershell script in task scheduler

powershell script in task scheduler

If you want learn more about available options please visit official Microsoft Docs Page.

3. Test running Powershell script in Task Scheduler

When you finished setting the task I always recommend to test it. Sometimes one spelling mistake can generate the problem.

powershell script in task scheduler

Free Task Scheduler Script template

If you run Powershell scripts in Task Scheduler I recommend for you:

  • Generate log file – I recommend using log to file function. When script have problem you can check log files to find what is wrong. 
  • It’s not best practices but I like use *.ini file to use like param file. The example scenario is when you want to change recipient email address for notification you don’t have to edit script or task parameters but only edit param file dedicated for it.

For faster write Powershell script for task scheduler I prepare template with build-in functions to generate log file and read all parameters from ini file. You can download Task Scheduler Powershell Script Template here.

Thanks for visit my blog and see you later 🙂

Get Access to Poshland Resources for FREE!!!

Signup now and receive an email once I publish new content.

I agree to have my personal information transfered to MailChimp ( more information )

I will never give away, trade or sell your email address. You can unsubscribe at any time.

Damian Garbus

Hi, My name is Damian. I'm Powershell geek. Also, I love to improve my productivity and yourself development. I connected Powershell and my productivity tricks and built this blog. You can find here how to learn Powershell and use this to improve your productivity. Enjoy.

Leave a Reply

Your email address will not be published.