Search
Twitter
Subscribe

Entries in Windows (1)

Monday
Aug132012

Convert-WindowsImage.ps1 -ShowUI

I have used WIM2VHD.wsf in the past, and now that I'm spending more time in Hyper-V (both in Windows 8 Release Preview, and in Server 2012 Release Candidate), this Convert-WindowsImage.ps1 PowerShell script provides a nicely improved workflow for quickly creating new VHD (or VHDX) files.

Here's an example of how you can use it in a GUI mode. In this example, I pointed the source to the Windows Server 2012 RC ISO that I downloaded, and created a new dynamic 40GB VHDX from the Standard edition within that ISO.

PS E:\scripts> .\Convert-WindowsImage.ps1 -ShowUI

Note: the current directory where the script is launched from will be the path where the new VHD or VHDX will be created.

Windows(R) Image to Virtual Hard Disk Converter for Windows(R) 8
Copyright (C) Microsoft Corporation.  All rights reserved.
Version 6.2.8424.0.amd64fre.fbl_core1_hyp_dev(mikekol).120517-1616 Release Preview
INFO   : Launching UI...

 

INFO   : Opening ISO 8400.0.WINMAIN_WIN8RC.120518-1423_X64FRE_SERVER_EN-US-HRC_SSS_X64FRE_EN-US_DV5.ISO...
INFO   : Looking for H:\sources\install.wim...
INFO   : Scanning WIM metadata...
INFO   : Selected Working Directory is E:\Virtual Machines\Hyper-V Disks...
INFO   : Image 2 selected (ServerStandard)...
INFO   : Creating sparse disk...
INFO   : Attaching VHDX...
INFO   : Disk initialized...
INFO   : Disk partitioned...
INFO   : Volume formatted...
INFO   : Access path (I:\) has been assigned...
INFO   : Applying image to VHDX.  This could take a while...
INFO   : Signing disk...
INFO   : Image applied.  Making image bootable...
INFO   : Opening I:\boot\bcd for configuration...
INFO   : BCD configuration complete. Moving on...
INFO   : Drive is bootable.  Cleaning up...
INFO   : Closing VHDX...
INFO   : Closing Windows image...
INFO   : Done.

 

And now I have a new "Server2012RCstd.vhdx" that I can attach to a new virtual machine and boot!