MDT: Running a PowerShell Script During a Deployment

In this article, I 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 folder.

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

Move the spot to the desired location using the arrows then edit the Properties.

1Name the task
2 Enter the following command : powershell.exe -file “%ScriptRoot%\file-name.ps1”
3 %ScriptRoot%
4 Apply
5 OK
At the next deployment, the PowerShell script will be executed.

Related Posts

Deploy Windows with MDT and WDS
In this tutorial, I will explain how to use the Microsoft Deployment Toolkit (MDT) and Windows Deployment Services (WDS) pairing to deploy Windows images (7/8. (1) / 10) using the PXE boot. Prerequisites A server with the WDS role installed and confi

WDS: installation and configuration
In this tutorial, we will see how in place Windows Deployment Services (WDS). WDS is role included with Windows Server that allows to put a TFTP server for PXE boot and installation of images. With these services you can deploy computers (physical or

Printer mapping: GPO and Script
When setting up an Active Directory, one of the things you want to set up automatically is the printer mapping to the different users. Before setting up GPOs, you must have shared your printers. As for mapping network drives, I'll introduce you to tw

Leave a Comment