New-WindowsImage stalls with 0x8007007E, can’t load unattend.dll

dismpowershell-v4.0

I'm trying to convert capture a .VHDX as a .WIM file. The file in question is a syspreped Windows 7 generalized image.

  • I'm working on Windows 8.1 and I have the Windows ADK installed.
  • In powershell I issue the command.
    New-WindowsImafe -capturepath e:\ -name Windows7Image -ImagePath d:\wim\windows7.wim -description "Windows 7 Image"
  • The process begins to run but it ends with the following error:
new-windowsimage : Unable to load DLL 'unattend.dll': The specified module could not be found.
(Exception from HRESULT: 0x8007007E)
At line:1 char:1
+ new-windowsimage -capturepath e:\ -name windws7Image -ImagePath D:\wim\windows7. ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   + CategoryInfo          : NotSpecified: (:) [New-WindowsImage], DllNotFoundException
   + FullyQualifiedErrorId : System.DllNotFoundException,Microsoft.Dism.Commands.NewWindowsImageCommand

When I go to the image path I can confirm that the process has started. Not sure why it's trying to load unattend.dll. I am assuming it's not needed for this operation.

Best Answer

Of course, 30 minutes after trying a bounty for the first time, I realized what we were both doing wrong. This is the message you get if you run from Powershell (x86) on a 64-bit windows. It works fine from the non-x86 Powershell. For good measure, you need to run as admin as well.