Press "Enter" to skip to content

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

MDT: enable monitoring
Presentation In MDT, it is possible to activate the monitoring, which makes it possible to follow the deployment of the stations and to have a progress report from the console. The state of the deployments is kept for 3 days. Activation of the monito

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

GPO: Run a script when the computer starts
Presentation In this article, we will see how to set up a script that runs at startup of the post using Group Policy (GPO). The advantage of using this type of script is that it is executed with the Administrators rights, which makes it possible to l

Leave a Reply

Your email address will not be published. Required fields are marked *

It looks like you're using an adblocker.
We use ads to keep our content free. Please support us by turning off your adblocker.