Figure 1. Task scheduler

PowerShell is a very flexible tool for Windows and Windows-software administrators. You can do a lot of things with it. Sometimes you start to think of how to execute powershell scripts from Task Scheduler. It’s not enough just to add a PS-file in scheduler, you need to do something more.

1. Open Task Scheduler.

2. Press "Create Task..." button.

Figure 1. Task scheduler

Figure 1. Task scheduler

3. In the tab "General" enter name of your task. It might be anything you want. And choose option "Run whether user is logged on or not"

Figure 2. Tab "General"

Figure 2. Tab "General"

 

4. In the tab "Trigger" press "Add new" and fill something like this:

Settings: Daily

Repeat task every: 30 minutes

Figure 3. Tab "Trigger"

Figure 3. Tab "Trigger"

 

5. In the tab "Actions" press "New" and enter:

Action: Start a program

Program/sctipt: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

In "Start in (optional)" enter the directory where your powershell script is stored, for example, C:\Tools

In "Add arguments (optional)" enter ".\warmup.ps1"

Figure 4. Tab "Actions"

Figure 4. Tab "Actions"

 

6. The tab "Conditions" leave as it is.

Figure 5. Tab "Conditions"

Figure 5. Tab "Conditions"

Save and enter password of account.