Convert-WindowsImage.ps1 — WIM2VHD for Windows 10 (also Windows 8 and 8.1)

Convert-WindowsImage is the new version of WIM2VHD designed specifically for Windows 8 and above. Written in PowerShell, this command-line tool allows you to rapidly create sysprepped VHDX and VHDX images from setup media for Windows 7/Server 2008 R2, Windows 8/8.1/Server 2012/R2

4.6 Star
139,173 times
Add to favorites
E-mail Twitter Digg Facebook
  • Bug when used with TP4 Nano Server Image
    4 Posts | Last post February 17, 2016
    • There is a bug in this version that only occurs when being used against a WIM file with a single edition. The Server 2016 TP4 Nano Server WIM only contains a single edition.
      The bug starts on line 4075:
      $Edition   = $openWim.Images[0].ImageFlags
      It looks like the ImageFlags property is being used when it should be the ImageName or ImageIndex property to reference the edition. In Nano Server TP4 the ImageFlags is $null which causes an error to occur.
      ERROR  : The variable cannot be validated because the value $null is not a valid value for the Edition variable.
      Changing references to this property to ImageName resolves the issue.
      Note: This incorrect property is referenced in several places.
    • Have you tried using the Convert-WindowsImage.ps1 that is contained in the Nanoserver subdirectory on the TP4 distribution?  It is significantly different from the Convert-WindowsImage.ps1 here in the gallery.  The one from the TP4 distribution in only 3955 lines in length instead of 4565 lines.
    • Yes, I have used it and it works fine. However, we also use this same script to build VHDs from many other earlier versions of Windows (Server 2012 R2, Windows 10 Ent). This process is automated and using different scripts depending on the WIM is really not an ideal situation (and terribly error prone).
      Especially as the issue is easily resolved and I'm fairly certain it is a bug :)
    • FYI:
      Line 4075 reads:
      $Edition   = $openWim.Images[0].ImageFlags
      It should read:
      $Edition   = $openWim.Images[0].ImageName
  • Cannot find type [WIM2VHD.WimFile]
    1 Posts | Last post February 04, 2016
    • I'm getting the below error when running convert-windowsimage.ps1 with all the required params passed in.
      ERROR  : Cannot find type [WIM2VHD.WimFile]: verify that the assembly containing this type is loaded.
  • Edition specified as index doesn't work
    1 Posts | Last post January 29, 2016
    • In the latest version of script specifying edition using index doesn't work, it fails on a conversion. Can you please fix it? thanks
  • Is there a German Issue
    1 Posts | Last post January 24, 2016
    • I got allways the same error:
      PS>TerminatingError(Test-Path): "Das Argument kann nicht an den Parameter "Path" gebunden werden, da es sich um eine leere Zeichenfolge handelt."
  • Creating Azure VM VHD
    1 Posts | Last post January 18, 2016
    • Is there any usage of Convert-WindowsImage which creates a bootable Azure compatible OS VHD from ISO source? I've tried several configurations of Convert-WIndowsImage to create VHDs and uploading them to Azure as VM templates, but trying to create an Azure VM from these templates always fails.
      I think a workaround is to boot the VHD in Hyper-V, get everything settled, and then sysprep-- but I'm hoping to skip the Hyper-V step and make an Azure compatible VHD directly from ISO using Convert-WindowsImage
  • Any Chance of update for new windows 10 iso that use install.esd
    1 Posts | Last post January 17, 2016
    • Any Chance of update for new windows 10 iso that use install.esd ?
      am assume it will need some sorta  check if install.wim or install.esd existed?
      Am assume they some sorta if existed code in power shell
       $SourcePath  = "$($driveLetter):\sources\install.wim"
       $SourcePath  = "$($driveLetter):\sources\install.esd"
  • Convert-WindowsImage.ps1 is not working in My Windows 10 Laptop
    1 Posts | Last post December 21, 2015
    • Hi,
      I am trying to convert Windows10 ISO file using Convert-WindowsImage.ps1 from Windows10 Laptop. The Script is not running.
      Please anyone help me how to work on this issue.
  • d:\Convert-WindowsImage.ps1 -ShowUi
    4 Posts | Last post November 30, 2015
    • Hi
      I am trying to convert the OS image WIM We have to a Hyper-v format
      I run this  in power shell but IS NOT launching / opening any window ...doing nothing.
    • I'm in the same state, no error, nothing... and that is the disconcerting part. I tried running from an 8 and also 8.1, same story.
    • Me too :( no error nothing...anyone knows how to make it work? I am on windows 7
      pS C:\Windows\system32> D:\Convert-WindowsImage.ps1
      PS C:\Windows\system32> D:\Convert-WindowsImage.ps1
    • I came across this too. The documentation is wrong. You need to import the module first with import-module <PathToYourFile>\Convert-WindowsImage.ps1 and then call it without the ps1 extension like a typical powershell commandlet. Then you can run it with -verbose and you'll see what it's attempting to do. 
  • Release of 19/6/2015 is a BETA version??
    2 Posts | Last post November 23, 2015
    • The release I just downloaded is marked:
      Version 10.0.9000.0.amd64fre.fbl_core1_hyp_dev(mikekol).141224-3000 Beta
      And it crashes as stated by numerous others when using the -ShowUI switch.
      Furthermore, (perhaps this is depending on the Powershell version installed) one has to use Import-Module .\Convert-WindowsImage.ps1
        to load the module and then use the function
      Convert-WindowsImage -ShowUI
    • Ok, so I noticed the ShowUI part is now no longer supported.
      So I use this tool every time there is a new Windows release, as a Developer, not as an IT administrator.
      Would be nice if the ShowUI could just work for the (best practice) scenario of creating an image for client editions. (like Windows 10)
  • A few things I've noticed
    1 Posts | Last post November 15, 2015
    • Start with the most basic rendition. These 2 commands should and do work. 
      PS C:\test>. .\Convert-WindowsImage.ps1
      PS C:\test>Convert-WindowsImage -SourcePath c:\test\ent.iso -edition Enterprise
      If you get a null error related to the source, try to mount the disk image manually. mount-diskimage -imagepath c:\test\ent.iso. If this doesn't work manually, there's no way the script will be able to do it either. I had this issue on both of my domain joined computers. I created a Win 8 VM and was able to run the script no problem. 
      If you can't get it to use an iso, extract it and use the install.wim as source instead. This probably wont be enough if you cant manually mount the isos though. 
51 - 60 of 154 Items