The Blog

Scheduling PowerShell Tasks: Quick Overview

This post is a quick summary demonstrating how to run a PowerShell script from the Task Scheduler without and with passing parameters.

Run PowerShell Scripts from Windows Task Scheduler


Scheduling a PowerShell Script without Script Parameters


The Program to run is PowerShell.exe. This will run the PowerShell process and the next step (arguments) will run the script.


Add arguments (optional):

The argument should contain the path to the PowerShell script to be run. This works because the command argument "-File"


Running a PowerShell Script from Task Scheduler with Parameters

Task-Schedulder-Action with Parameters

Scheduling a PowerShell Script with Script Parameters



Add arguments (optional):

We use "-Command" argument to identify that we want to run the script file and pass through parameters. Executes the specified commands (and any parameters) as though they were typed at the Windows PowerShell command prompt, and then exits, unless the NoExit parameter is specified.

-Command "&amp; <em>'C:\ScriptFile.ps1</em>' <em>-Param1 'Value1' -Param2 'Value2</em>'"

Everything after "-Command" must be enclosed in double quotes and where you would normally use double quotes without the command replace them with single quotes.

Neil Bryan
IT Consultant & Technical Trainer
Neil Bryan is an IT consultant and technical trainer specializing in VMware, Citrix and Microsoft virtualization and infrastructure.

Leave a Reply

Skip to toolbar