Walkthrough: Create sysprepped VHD/VHDX image from setup media (.ISO file)

This post go throught step by step guide how to use PowerShell Script “Convert-WindowsImage.ps1” (you can download the script here). It’s very useful script to save time when doing sysprepped template disk.

1. Download the Convert-WindowsImage.ps1 script (link above)

2. Save it to sam location that your setup media  (that you are converting from .ISO to VHD/VHDX) is located. This example I’m using D:\

3. Open the script in notepad:




When opened Select all Text by pressing CTRL+A


4. Open PowerShell ISE as Administator (don’t close the notepad yet)


5. Paste the text to upper Window (text that you copied from noptepad)


6. Run the script by pressing f5 or green arrow on upper pane


7.When script is executed type Convert-WindowsImage and you note thet it’s loaded as function



8. Convert image with command like (note that I used function when converting the image):

D:\> Convert-WindowsImage -SourcePath D:\en_windows_server_technical_preview_2_x64_dvd_6651466.iso -VHDPath ThresholdTP2.vhdx -VHDFormat VHDX -Edition ServerStandard -VHDPartitionStyle GPT



Done. Hope you found this useful. If any issues, pls let us know.


Leave a Reply

Your email address will not be published. Required fields are marked *