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!
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:
.\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.
.\Convert-WindowsImage.ps1 -SourcePath D:\sources\install.wim -Edition Professional
.\Convert-WindowsImage.ps1 -SourcePath D:\Windows8RPx64.iso -VHDFormat VHDX -SizeBytes 60GB
.\Convert-WindowsImage.ps1 -SourcePath D:\Windows8RPx64.iso -VHDFormat VHDX -SizeBytes 48TB -VHDPath .\MyCustomName.vhdx
.\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:
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.
Be sure to check out these additional resources:
Keith Mayer is a Senior Technical Evangelist at Microsoft focused on Cloud and Enterprise platforms. Keith has over 20 years of experience as a technical leader of complex IT projects, in diverse roles, such as Network Engineer, IT Manager, Technical Instructor and Consultant. He has consulted and trained thousands of IT Pros worldwide on design of enterprise technology solutions.
Keith is currently certified on several Microsoft technologies, including Private Cloud, System Center, Hyper-V, Windows, Windows Server, SharePoint and Exchange. He also holds other industry certifications from VMware, IBM, Cisco, Citrix, HP, CheckPoint, CompTIA and Interwoven.
You can contact Keith online at http://aka.ms/AskKeith.