DISM cmdlets fail to run in WinPE (MDT 2013 Update 1)

Hi All,

We’ve recently started using MDT 2013 Update 1 and we’ve noticed some of the scripts that worked seamlessly in 2012 have started producing errors. We use the DISM PowerShell cmdlets to verify the consistency of WIM files post backup. If the cmdlet fails to verify the WIM file the build bombs out to prevent data loss.

Here’s the error we’ve been seeing:

The ‘Get-WindowsImage’ command was found in the module ‘Dism’, but the module could not be loaded. For more information, run ‘Import-Module Dism’

Googling has found the following workarounds:

Enable Loading from remote sources – This didn’t work reliably for us.

Replace corrupt Dism dll with a working one – This method worked for us but I’d like to expand on it.

Thanks to the guys at DeploymentPros we were able to overcome this problem. What ended up working best for us was a Powershell script that deleted the corrupt dll and copied down a fresh one from the deployment share.

We found the DISM dll included in the Assessment and Deployment Kit located here: C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\x86\DISM\Microsoft.Dism.Powershell.dll and copied it to our Scripts folder inside our deployment share. Then added a step to the task sequence to run the PowerShell script.



Here’s the guts of the script, nothing much to it:


However we’ve added quite a bit of logging in our final script:


Please let us know if this worked for you, or if you’ve found any alternative solutions!

Cheers, John.

Leave a Reply

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