Skip to content

Convert-WindowsImage.ps1 broken on 1709 #38

@pbolduc

Description

@pbolduc

Hi Ben, I know you do not support Convert-WindowsImage.ps1 from the TechNet Gallery. However, I am trying find out what changed from 1703 to 1709 of Windows 10 that breaks the image converter. Something changed in the API WimApplyImage from Wimgapi.dll

Any assistance you can provide would be appreciated.

This change breaks the vhdx creation in Hyper-V-PowerShell scripts on Windows 10.

I could try to modify to use the Convert-WindowsImage.ps1 from the NanoServerImageGenerator on Windows Server 2016 disk, but I am unsure about the licensing of that script. It says:

Use of this sample source code is subject to the terms of the Microsoft
license agreement under which you licensed this sample source code.

I know there is someone at Microsoft knows what changed with this API in 1709.

Here is the error you get when running the image factory on Windows 10 Pro 1709.

Exception calling "Apply" with "1" argument(s): "The directory or file cannot be created"

full log:

Windows(R) Image to Virtual Hard Disk Converter for Windows(R) 10
Copyright (C) Microsoft Corporation.  All rights reserved.
Version 10.0.9000.0.amd64fre.fbl_core1_hyp_dev(mikekol).141224-3000 Beta

INFO   : Opening ISO en_windows_server_2016_x64_dvd_9327751.iso...
INFO   : Looking for E:\sources\install.wim...

INFO   : Image 4 selected (ServerDataCenter)...
INFO   : Creating sparse disk...
INFO   : Attaching VHDX...
INFO   : Disk initialized with GPT...
INFO   : Disk partitioned
INFO   : System Partition created
INFO   : Boot Partition created
INFO   : System Volume formatted (with DiskPart)...
INFO   : Boot Volume formatted (with Format-Volume)...
INFO   : Access path (F:\) has been assigned to the System Volume...
INFO   : Access path (\\?\Volume{4a8daf5b-08cc-499f-ba80-456d6f68cb38}\) has been assigned to the Boot Volume...
INFO   : Applying image to VHDX. This could take a while...
ERROR  : Exception calling "Apply" with "1" argument(s): "The directory or file cannot be created"
INFO   : Log folder is C:\Users\Phil\AppData\Local\Temp\Convert-WindowsImage\ce2f5e7c-e52a-4e13-b296-fff0fa6e64af

INFO   : Closing Windows image...
INFO   : Closing VHDX...
INFO   : Closing ISO...
INFO   : Done.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions