MDT: Running a PowerShell Script During a Deployment

In this tutorial, I will explain how to run a PowerShell script (.ps1 file) during a deployment with MDT.

Copy the ps1 1 file to the Scripts folder in the DeploymentShare folder.

DeploymentShare folder

Open the properties of the task sequence then add a task of type Run Command Line 1.

Move the task to the desired location using the arrows then edit the properties: name the task 1. In the Command line 2 field enter powershell.exe -file "%ScriptRoot%\file-name.ps1". In the Start in 3 field indicate %ScriptRoot% then validate by pressing the Apply button 4 and OK 5.

The next time you deploy with this task sequence, the PowerShell script will be executed.



Related Posts


Offline installation of Office 365

Table Of ContentsGetting the sources of Office 365Installation In this tutorial, I will explain how to install Office 365 in offline mode. As part of an enterprise deployment, it is not possible to do

Jenkins: centralizing the management of scheduled tasks

Jenkins is a free open source software for continuous integration. It is normally used by development equipment to ensure non-regression of source code. In turn, it is possible to use Jenkins as a sch

Deploy Windows with MDT and WDS

In this tutorial, we will see how to use the couple MDT (Microsoft Deployment Toolkit) and WDS (Windows Deployment Services) to deploy Windows images. The pair WDS and MDT to deploy images by starting

Scroll to Top