MDT allows you to create Windows PowerShell scripts, and then run those scripts as a part of a MDT task sequence using the Run PowerShell Script task sequence step type. The Windows PowerShell scripts that you create can perform any typical automation supported by the target operating system.

Create Windows PowerShell scripts for use in MDT by:

·     Including the prerequisites in your Windows PowerShell script for running in MDT as described in Include Prerequisites for Running Windows PowerShell Scripts in MDT

·     Using task sequence variables within your Windows PowerShell script as described in Use Task Sequence Variables Within Windows PowerShell Scripts

·     Updating the MDT logs with output from your Windows PowerShell scripts as described in Update MDT Logs Using Windows PowerShell Scripts

·     Interpreting Windows PowerShell return codes generated by your script as described in Interpret Windows PowerShell Script Return Codes

Related Topics

Creating Custom Scripts for MDT
Include Prerequisites for Running Windows PowerShell Scripts in MDT
Use Task Sequence Variables Within Windows PowerShell Scripts
Update MDT Logs Using Windows PowerShell Scripts
Interpret Windows PowerShell Script Return Codes