x0nn / Convert-WindowsImage

Creates a Windows VM for Hyper-V from a Windows-ISO
GNU General Public License v3.0
76 stars 21 forks source link

Can't get this version to actually run #7

Closed BWMerlin closed 4 years ago

BWMerlin commented 4 years ago

I am trying to run the following command it executes but nothing actually happens.

.\Convert-WindowsImage -SourcePath "C:\Users\Administrator\Downloads\SW_DVD9_Win_Pro_10_1909_64BIT_English_Pro_Ent_EDU_N_MLF_X22-17395.ISO" -VHDFormat "VHDX" -SizeBytes 50GB -DiskLayout "UEFI" -VHDPath "C:\win10.vhdx"

The powershell gallery version is not the code from this repo - comment added by @x0nn

When I run the PSGallery version (I installed it while trying to troubleshoot this problem) Convert-WindowsImage -SourcePath "C:\Users\Administrator\Downloads\SW_DVD9_Win_Pro_10_1909_64BIT_English_Pro_Ent_EDU_N_MLF_X22-17395.ISO" -VHDFormat "VHDX" -SizeBytes 50GB -DiskLayout "UEFI" -VHDPath "C:\win10.vhdx"

It executes but throws errors about not finding WinPE (I have installed WinPE as well and still get this error).

Get-ItemProperty : Cannot find path 'HKLM:\Software\Microsoft\Windows NT\CurrentVersion\WinPE' because it does not exist. At C:\Program Files\WindowsPowerShell\Modules\Convert-WindowsImage\10.0\Convert-WindowsImage.psm1:746 char:38

The property 'Version' cannot be found on this object. Verify that the property exists. At C:\Program Files\WindowsPowerShell\Modules\Convert-WindowsImage\10.0\Convert-WindowsImage.psm1:746 char:21

Convert-WindowsImage : The variable '$hyperVEnabled' cannot be retrieved because it has not been set. At line:1 char:1

Dismount-DiskImage : A parameter cannot be found that matches parameter name 'PassThru'. At C:\Program Files\WindowsPowerShell\Modules\Convert-WindowsImage\10.0\Convert-WindowsImage.psm1:2401 char:77

x0nn commented 4 years ago

Hi,

the problem is, that the script is using a function to work. Your first command uses the script directly and therefore nothing happens. Please dotsource the script fist, then run the command like mentioned in the readme and give a short feedback.

Best Regards