Import MDT PowerShell module

When using PowerShell with MDT you need to import the MDT PowerShell module.
The module is located in the Bin folder under the MDT installation folder.

If you have installed MDT on C: then It’s probebly located here:
C:\Program Files\Microsoft Deployment Toolkit\Bin

Then you import it like this:
Import-Module “C:\Program Files\Microsoft Deployment Toolkit\bin\MicrosoftDeploymentToolkit.psd1”

This is not rocket science.

But I don’t wan’t  my scripts to be hard coded and I wan’t my scripts to do as many checks as possible.

This script first checks if MDT is installed and then tries to Import the module from the system drive first and then the D: drive.

The best way would be to check the installation and check where it is installed.
But that information is not provided.

So this is a simple solution to catch more then one location.



Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.