Closed suntong closed 3 years ago
Hi,
thanks for your feedback. Please append the parameters you used.
Convert-WindowsImage -DiskLayout BIOS -VHDFormat VHD -BCDinVHD VirtualMachine -ExpandOnNativeBoot:$false -Edition "Windows 10 Pro N" -SizeBytes 30GB -SourcePath E:\sources\install.esd -VHDPath ...
and I just ran without the -BCDinVHD VirtualMachine
part, and confirm that the problem is still the same.
I'm blocked on the same error:
From Win10 21H1 PS5.1, repros the same with or without my profile loading (powershell -noprofile).
Looking at the code I'm wondering if it's something to do with the braces in bcdedit args around line 2082.
PS C:\> Convert-WindowsImage -SourcePath c:\iso\en_windows_server_2016_updated_feb_2018_x64_dvd_11636692.iso -Edition 'Windows Server 2016 Datacenter (Desktop Experience)' -DiskLayout BIOS -VHDPath D:\vhds\test.vhd -Verbose
Windows(R) Image to Virtual Hard Disk Converter for Windows(R) 10 Copyright (C) Microsoft Corporation. All rights reserved. Version 10.0.14278.1000.amd64fre.rs1_es_media.160201-1707 VERBOSE: Target Image Version 10.0.19043.1052 VERBOSE: 2021-07-08T03:12:02 [TEN] Temporary VHD path is : D:\vhds\22409e74-daa9-4dac-9aed-724521bd3aba.vhd VERBOSE: 2021-07-08T03:12:02 [TEN] Opening ISO en_windows_server_2016_updated_feb_2018_x64_dvd_11636692.iso... Attached : True
BlockSize : 0
DevicePath : \\.\CDROM0
FileSize : 6006587392
ImagePath : C:\iso\en_windows_server_2016_updated_feb_2018_x64_dvd_11636692.iso
LogicalSectorSize : 2048
Number : 0
Size : 6006587392
StorageType : 1
PSComputerName :
VERBOSE: 2021-07-08T03:12:03 [TEN] Looking for c:\iso\en_windows_server_2016_updated_feb_2018_x64_dvd_11636692.iso...
VERBOSE: 2021-07-08T03:12:03 [TEN] Looking for the requested Windows image in the WIM file
VERBOSE: 2021-07-08T03:12:04 [TEN] Image 4 selected (Windows Server 2016 Datacenter (Desktop Experience))...
VERBOSE: 2021-07-08T03:12:04 [TEN] Creating sparse disk...
VERBOSE: 2021-07-08T03:12:06 [TEN] Mounting VHD...
VERBOSE: 2021-07-08T03:12:06 [TEN] Initializing disk...
VERBOSE: 2021-07-08T03:12:06 [TEN] Creating single partition...
VERBOSE: 2021-07-08T03:12:06 [TEN] Formatting windows volume...
VERBOSE: 2021-07-08T03:12:09 [TEN] Windows path (G:) has been assigned.
VERBOSE: 2021-07-08T03:12:09 [TEN] Windows path (G:) took 1 attempts to be assigned.
VERBOSE: 2021-07-08T03:12:09 [TEN] System volume location: G:
VERBOSE: 2021-07-08T03:12:09 [TEN] Applying image to VHD. This could take a while...
VERBOSE: 2021-07-08T03:15:35 [TEN] Image was applied successfully.
VERBOSE: 2021-07-08T03:15:35 [TEN] Making image bootable...
VERBOSE: 2021-07-08T03:15:38 [TEN] Fixing the Device ID in the BCD store on VHD...
Write-LogMessage : 2021-07-08T03:15:38 [TEN] Error formatting a string: Input string was not in a correct format..
At C:\OneDrive\My\Convert-WindowsImage.ps1:2313 char:13
+ Write-LogMessage $_ -logType Error
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Write-LogMessage
VERBOSE: 2021-07-08T03:15:38 [TEN] Log folder is C:\Users\clandis\AppData\Local\Temp\Convert-WindowsImage\22409e74-daa9-4dac-9aed-724521bd3aba
VERBOSE: 2021-07-08T03:15:40 [TEN] Closing ISO...
Attached : False
BlockSize : 0
DevicePath :
FileSize : 6006587392
ImagePath : C:\iso\en_windows_server_2016_updated_feb_2018_x64_dvd_11636692.iso
LogicalSectorSize : 2048
Number :
Size : 6006587392
StorageType : 1
PSComputerName :
VERBOSE: 2021-07-08T03:15:41 [TEN] Done.
Hi,
thanks for your feedback and patience. I found the error and fixed it. I will merge the code today.
Best Regards
Getting the following error:
Tried twice, and the error is exactly the same. Apparently it comes from:
https://github.com/x0nn/Convert-WindowsImage/blob/21f2abb8abce04d820c3e384de553e266bfc9b0d/Convert-WindowsImage.ps1#L2312-L2316
Here is the full log:
Other logs look good except the file
bcdboot.exe-StandardOutput.txt
: