• 10
  • 9
  • 8
  • 7
  • 6
  • 5
  • 1
  • 4
  • 3
  • 2

on August 7 | in Microsoft | by | with No Comments

Hey Geeks,

starting to make my first experience with the PDT (powershell Deployment Toolkit), I cannot get around from the “convert-windowsimage.ps1” to convert my .wim or .ISO File into a .vhdx that I can use as a parent disk for my created VM`s.

Since I have spent a lot of time for troubleshooting, I would like to give you some advice for creating your ”.vhdx” and make it available without errors.


I execute my script, but nothing works.

What happened?

The difference between the actual version of the “convert-windowsimage.ps1” and the older one (I think back about a year) is that we use a function in the script.

This is the reason that nothing appears, because we have to call the Function, before we execute it.


So let`s start:

  1. So, if you try to execute the script, nothing happens!


To call the function we have different possibilities to do that.


Let me tell you what I prefer:

Insert the CMDLets to create your VHD

  1. Please open the “convert-windowsimage.ps1” in a Text editor like “Notepad” or as me, “Notepad++”
  2. Take note, that it looks like that at the end of your script



  1. At the end of the script after “ } ” press Enter and add the following line:


Convert-WindowsImage -SourcePath D:ISOsen_windows_server_2012_r2_x64_dvd_2707946.iso -VHDPath C:W2K12R2.VHDX -VHDFormat VHDX -VHDPartitionStyle GPT -SizeBytes 60GB -Edition ServerStandard


So that it looks like that:


Take care, that you Change your –SourcePath and –VHDPath

  1. Save the Settings
  2. Open Powershell as Administrator and execute “convert-windowsimage.ps1”



Now we created a functional VHDX, that we can use as Disk for our VM`s.

But let`s see what happens


Decide to generate "Generation 1" or "Generation 2" VM

If we create a “Generation 1” VM


And Choose our created “.VHDX” file as Virtual Disk


we become the following message:

Boot failure. Reboot and Select proper Boot Device or Insert Boot Media in selected Boot device

(One of the most important Errors I saw in Technet)


You guess, what should comes next…

Let us try to create a “Generation2” VM


Select again our created VHDX file


And see what happened:


So why does it works with “Generation2” VM`s ,But nut with “Generation1”?


Let`s have a look back of the added line:

Convert-WindowsImage -SourcePath D:ISOsen_windows_server_2012_r2_x64_dvd_2707946.iso -VHDPath C:W2K12R2.VHDX -VHDFormat VHDX -VHDPartitionStyle GPT -SizeBytes 60GB -Edition ServerStandard


“-VHDPartitionStyle GPT” is responsible that we can only boot from generation 2 VM`s

Change it to “-VHDPartitionStyle MBR” to boot the Generation1 VM.


If you use the Powershell Deployment Toolkit u can specify the settings for the Generation in the “variable.xml”

Explained in the following article:


Pin It

Leave a Reply

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


Scroll to top