Convert-WindowsImage is the new version of WIM2VHD for Windows 8 and Windows Server 2012!

Rapid provisioning of new VHD/VHDX "gold" images for lab, development, test, and production use!

Designed specifically for Windows 8 and Windows Server 2012, and completely rewritten in PowerShell by Mike Kolitz, this command-line tool allows you to rapidly create sysprepped VHD and VHDX images from setup media for Windows 7/Server 2008 R2 and Windows 8/Server 2012.  This is a great tool for quickly building new VHD/VHDX disks for development, lab, test and production "gold" VM images.  Note that support for the new expanded VHDX format available in Windows Server 2012 is completely new for this tool!

Images created by Convert-WindowsImage will boot directly to the Out Of Box Experience (OOBE), ready for your first-use customizations. You can also use these images for automation by supplying your own unattend.xml file, making the possibilities limitless. The resulting images will work with Virtual PC (Windows 7 only), Virtual Server (Windows 7 only), Microsoft Hyper-V, or Windows Native Boot-to-VHD functionality!

System Requirements

Convert-WindowsImage can only be executed from a machine running Windows 8 Consumer Preview, Windows 8 Release Preview, Windows Server 2012 Beta or Windows Server 2012 Release Candidate.  If you haven't downloaded and installed one of these operating systems in your lab yet, get the latest versions here:

Sounds great!  But … how do I use it?

Here's some quick PowerShell examples showing how you can use Convert-WindowsImage in your own lab: 

  • Show the Graphical User Interface

.\Convert-WindowsImage.ps1 -ShowUI

  • Create a VHD using all default settings from D:\sources\install.wim.

.\Convert-WindowsImage.ps1 -SourcePath D:\sources\install.wim  
# Since no edition is being specified, the command will succeed if there is only one image in the specified WIM file. If there are multiple images, the command will fail and it will list the possible editions.

  • Create a VHD using all default settings from D:\sources\install.wim while specifying an edition.

.\Convert-WindowsImage.ps1 -SourcePath D:\sources\install.wim -Edition Professional

  • Create a 60GB VHDX, using all default settings, from D:\Windows8RPx64.iso.

.\Convert-WindowsImage.ps1 -SourcePath D:\Windows8RPx64.iso -VHDFormat VHDX -SizeBytes 60GB

  • Create a 48TB VHDX from D:\WindowsRPx64.iso with a custom file name. :-D

.\Convert-WindowsImage.ps1 -SourcePath D:\Windows8RPx64.iso -VHDFormat VHDX -SizeBytes 48TB -VHDPath .\MyCustomName.vhdx

  • Use WIM2VHD-style argument names to create a 20GB fixed VHDX with a custom name and an unattend file from D:\foo.wim, and return the path to the created VHDX on the pipeline.

.\Convert-WindowsImage.ps1 -WIM D:\foo.wim -Size 20GB -DiskType Fixed -VHDFormat VHDX -Unattend D:\myUnattend.xml -VHD D:\scratch\foo.vhdx -passthru

Where do I get my own copy of Convert-WindowsImage?

You can download Convert-WindowsImage directly from the Microsoft ScriptCenter Repository at the following link location:

http://gallery.technet.microsoft.com/scriptcenter/Convert-WindowsImageps1-0fe23a8f

Are you planning to use Convert-WindowsImage within your own Lab?

Be sure to comment below on how you're planning to use Convert-WindowsImage in your own lab!  Each of our ideas for using this script may be unique, so let's share our ideas and build on each other.  Better yet, if you find this script useful, be sure to Tweet it or Share it with your community using the social links at the top of this article.