none
Import-WdsInstallImage : An install image could not be found in the image file RRS feed

  • Question

  • As asked from here I ask my question on the PowerShell forum.

    Hello,

    The WDS server is a freshly installed Win 2019 server.

    I am trying to import install images with PowerShell.

    $ImagePath = 'D:\Sources\2019\install.wim'
    $ImageName = (Get-WindowsImage -ImagePath $ImagePath -Index 4).ImageName
    Import-WdsInstallImage -ImageGroup 'Win2019' -ImageName $ImageName -Path $ImagePath -Multicast

    However I get the following error:

    Import-WdsInstallImage : An install image could not be found in the image file.
    At line:3 char:1
    + Import-WdsInstallImage -ImageGroup 'Win2019' -ImageName $ImageName -P ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (MSFT_WdsInstallImage:root/cimv2/MSFT_WdsInstallImage) [Import-WdsInstallImage], CimException
        + FullyQualifiedErrorId : 0xC111010E,Import-WdsInstallImage

    The image file is NOT read-only.

    And with the console it works fine.

    I also installed the latest system rollup, but the behavior is the same.

    I first started to display image names with Get-WindowsImage and copy/paste the name to the Import-WdsInstallImage and got the same error. That's why I was getting directly the name from the Get-WindowsImage cmdlet. But no luck, still the same error...

    And while the Import-WdsInstallImage returns an error, the Import-WdsBootImage and the Get-WindowsImage cmdlets are works fine.

    Does anybody see what's wrong with my code or my command lines?
    • Edited by Luc Fullenwarth Thursday, July 18, 2019 8:47 AM
    • Moved by jrv Saturday, August 3, 2019 9:23 PM Best forum
    Thursday, July 18, 2019 8:40 AM

Answers

  • This is a PowerShell issue.

    When I connect the ISO file to a Win 2012R2  or a  Win 2016 computer I have this output :

    PS> Get-WindowsImage -ImagePath Z:\sources\install.wim
    
    
    Index       : 1
    Name        : Windows Server 2019 SERVERSTANDARDCORE
    Description : Windows Server 2019 SERVERSTANDARDCORE
    Size        : 8 092 332 038 bytes
    
    Index       : 2
    Name        : Windows Server 2019 SERVERSTANDARD
    Description : Windows Server 2019 SERVERSTANDARD
    Size        : 14 308 216 364 bytes
    
    Index       : 3
    Name        : Windows Server 2019 SERVERDATACENTERCORE
    Description : Windows Server 2019 SERVERDATACENTERCORE
    Size        : 8 081 038 156 bytes
    
    Index       : 4
    Name        : Windows Server 2019 SERVERDATACENTER
    Description : Windows Server 2019 SERVERDATACENTER
    Size        : 14 312 166 767 bytes
    
    PS>

    When I connect the ISO file to a Win 2019 computer I have this output :

    PS> Get-WindowsImage -ImagePath Z:\sources\install.wim
    
    ImageIndex       : 1
    ImageName        : Windows Server 2019 Standard
    ImageDescription : (Recommended) This option omits most of the Windows graphical environment. Manage with a command prompt and PowerShell, or remotely with Windows Admin Center or other tools.
    ImageSize        : 8,092,332,038 bytes
    
    ImageIndex       : 2
    ImageName        : Windows Server 2019 Standard (Desktop Experience)
    ImageDescription : This option installs the full Windows graphical environment, consuming extra drive space. It can be useful if you want to use the Windows desktop or have an app that requires it.
    ImageSize        : 14,308,216,364 bytes
    
    ImageIndex       : 3
    ImageName        : Windows Server 2019 Datacenter
    ImageDescription : (Recommended) This option omits most of the Windows graphical environment. Manage with a command prompt and PowerShell, or remotely with Windows Admin Center or other tools.
    ImageSize        : 8,081,038,156 bytes
    
    ImageIndex       : 4
    ImageName        : Windows Server 2019 Datacenter (Desktop Experience)
    ImageDescription : This option installs the full Windows graphical environment, consuming extra drive space. It can be useful if you want to use the Windows desktop or have an app that requires it.
    ImageSize        : 14,312,166,767 bytes
    
    PS>

    Solution: Connect or mount the ISO file to a Win 2016 or earlier in order to get the right image names.

    Sunday, August 4, 2019 7:56 AM

All replies

  • Hi,

    Thanks for your question.

    Have you added the Double quotes in your image name?

    Sorry, I didn't find the powershell command syntax. Please check the health of your image file.

    Best regards,

    Lee


    Just do it.

    Monday, July 22, 2019 8:11 AM
  • Hi,

    Was your issue resolved?

    If you resolved it using our solution, please "mark it as answer" to help other community members find the helpful reply quickly.

    If you resolve it using your own solution, please share your experience and solution here. It will be very beneficial for other community members who have similar questions.

    If no, please reply and tell us the current situation in order to provide further help.

    Best Regards,

    Lee


    Just do it.

    Wednesday, July 31, 2019 7:23 AM
  • I finally figured out that the name was wrong.

    I use two command lines to find the name of images inside a WIM file:

    Get-WindowsImage -ImagePath X:\Sources\install.wim

    and

    dism /get-imageinfo /imagefile:X:\Sources\2019\install.wim

    Unfortunately, both are returning these image names:

    • Windows Server 2019 Standard
    • Windows Server 2019 Standard (Desktop Experience)
    • Windows Server 2019 Datacenter
    • Windows Server 2019 Datacenter (Desktop Experience)

    In fact, the image name I have to provide to the Import-WdsInstallImage cmdlet or WDSUTIL /Add-Image commandl-ine art the following.

    • Windows Server 2019 SERVERSTANDARDCORE
    • Windows Server 2019 SERVERSTANDARD
    • Windows Server 2019 SERVERDATACENTERCORE
    • Windows Server 2019 SERVERDATACENTERCORE

    So I am only half away from the solution.
    I guessed the number by "cheating" and importing the images with the WDS console.

    But to have a full solution I want to be able to find the real image names directly with the command line.

    Any idea?


    • Edited by Luc Fullenwarth Saturday, August 3, 2019 7:12 PM Wrong command line
    Saturday, August 3, 2019 6:53 PM
  • Get-WindowsImage -ImagePathX:\Sources\install.wim | Select *

    Or -

    Get-WindowsImage -ImagePathX:\Sources\install.wim | Select ImageName


    \_(ツ)_/


    • Edited by jrv Saturday, August 3, 2019 6:58 PM
    Saturday, August 3, 2019 6:56 PM
  •   <Type>
        <Name>Microsoft.Dism.Commands.WimImageInfoObject</Name>
        <Members>
          <ScriptProperty>
            <Name>Version</Name>
            <GetScriptBlock>"{0}.{1}.{2}.{3}" -f $this.MajorVersion, $this.MinorVersion, $this.Build, $this.SPBuild</GetScriptBlock>
          </ScriptProperty>
          <MemberSet>
            <Name>PsStandardMembers</Name>
            <Members>
              <NoteProperty>
                <Name>DefaultDisplayProperty</Name>
                <Value>ImagePath</Value>
              </NoteProperty>
              <PropertySet>
                <Name>DefaultDisplayPropertySet</Name>
                <ReferencedProperties>
                  <Name>ImagePath</Name>
                  <Name>ImageName</Name>
                  <Name>ImageIndex</Name>
                  <Name>ImageDescription</Name>
                  <Name>ImageSize</Name>
                  <Name>WIMBoot</Name>
                  <Name>Architecture</Name>
                  <Name>ProductName</Name>
                  <Name>EditionId</Name>
                  <Name>InstallationType</Name>
                  <Name>Hal</Name>
                  <Name>ProductType</Name>
                  <Name>ProductSuite</Name>
                  <Name>Version</Name>
                  <Name>SPLevel</Name>
                  <Name>SystemRoot</Name>
                  <Name>Languages</Name>
                  <Name>DefaultLanguageIndex</Name>
                  <Name>DirectoryCount</Name>
                  <Name>FileCount</Name>
                  <Name>CreatedTime</Name>
                  <Name>ModifiedTime</Name>
                </ReferencedProperties>
              </PropertySet>
              <PropertySet>
                <Name>DefaultKeyPropertySet</Name>
                <ReferencedProperties>
                  <Name>ImagePath</Name>
                </ReferencedProperties>
              </PropertySet>
            </Members>
          </MemberSet>
        </Members>
      </Type>
    


    \_(ツ)_/

    Saturday, August 3, 2019 7:02 PM
  • To get only installable images from a file this is the correct command:

    Get-Wds​Install​Image


    \_(ツ)_/

    Saturday, August 3, 2019 7:06 PM
  • If you read my answer, Get-WindowsImage is the command line I use to get image names.

    However, these names are like:

    Windows Server 2019 Standard

    And they should be like this instead:

    Windows Server 2019 SERVERSTANDARDCORE

    Saturday, August 3, 2019 7:17 PM
  • The Get-WdsInstallImage is the cmdlet which lists images already imported into WDS.
    It's already too late...

    I need the right names before, in order to import them into WDS.



    Saturday, August 3, 2019 7:20 PM
  • If you read my answer, this command line is the one I use to get image names.

    However, this names are like:

    Windows Server 2019 Standard

    And they should be like this instead:

    Windows Server 2019 SERVERSTANDARDCORE

    I can only give you the information on how to use PS to get the correct names of "installable" images in a file.  I can't do it for you.

    The command you used is not the correct command.  Use the command I posted a link to.


    \_(ツ)_/

    Saturday, August 3, 2019 7:21 PM
  • Here is the output:

    PS > Get-WindowsImage -ImagePath X:\Sources\install.wim | Select ImageName
    
    ImageName                                          
    ---------                                          
    Windows Server 2019 Standard                       
    Windows Server 2019 Standard (Desktop Experience)  
    Windows Server 2019 Datacenter                     
    Windows Server 2019 Datacenter (Desktop Experience)
    
    

    These names are not the names I can provide to the import cmdlet or command line.

    And for the Get-WdsInstallImage cmdlet, like I said, it only lists images already imported inside WDS.

    If you don't believe me try it yourself. I already tried it out.

    Saturday, August 3, 2019 7:30 PM
  • Now just filter and pipeline it:

    Get-WindowsImage -ImagePathX:\Sources\install.wim |Where{$_.ImageName -eq 'Windows Server 2019 Standard'}

    Now you have the image you are looking for.

    Have you tried:

    Get-WdsInstallImage  -FileName  D:\Sources\2019\install.wim


    \_(ツ)_/

    Saturday, August 3, 2019 8:05 PM
  • Get-WdsInstallImage  -FileName  D:\Sources\2019\install.wim

    ==> returns nothing

    Get-WindowsImage -ImagePathX:\Sources\install.wim |Where{$_.ImageName -eq 'Windows Server 2019 Standard'}

    ==> It seems you don't understand my problem.
    I will try to explain it differently:

    I need to import images into WDS.

    Import-WdsBootImage -ImageName 'Windows Server 2019 Standard'

    ==> this name returns an error

    Import-WdsInstallImage -ImageName 'Windows Server 2019 SERVERSTANDARDCORE'

    ==> this name works fine

    All names I get with Get-WindowsImage or DISM are:

    • Windows Server 2019 Standard
    • Windows Server 2019 Standard (Desktop Experience)
    • Windows Server 2019 Datacenter
    • Windows Server 2019 Datacenter (Desktop Experience)

    However, these names are not working neither with Import-WdsInstallImage nor the WDSUTIL tool.

    But the names which are working are:

    • Windows Server 2019 SERVERSTANDARDCORE
    • Windows Server 2019 SERVERSTANDARD
    • Windows Server 2019 SERVERDATACENTERCORE
    • Windows Server 2019 SERVERDATACENTER

    How can I get those last names?

    Saturday, August 3, 2019 9:04 PM
  • That'really strange. I don't have the same output than this guy, who has the correct names...

    I even tried with a Windows 2012R2 genuine ISO file downloaded from Microsoft's site.

    PS> Get-WindowsImage -ImagePath Z:\sources\install.wim
    
    ImageIndex       : 1
    ImageName        : Windows Server 2012 R2 Standard (Server Core Installation)
    ImageDescription : This option (recommended) reduces management and servicing by installing only what is needed to run most server roles and applications.It does not include a GUI, but you can fully manage the server locally or remotely with Windows 
                       PowerShell or other tools. You can switch to a different installation option later. See "Windows Server Installation Options."
    ImageSize        : 6,674,506,847 bytes
    
    ImageIndex       : 2
    ImageName        : Windows Server 2012 R2 Standard (Server with a GUI)
    ImageDescription : This option is useful when a GUI is required—for example, to provide backward compatibility for an application that cannot be run on a Server Core installation. All server roles and features are supported. You can switch to a different 
                       installation option later. See "Windows Server Installation Options."
    ImageSize        : 11,831,211,505 bytes
    
    ImageIndex       : 3
    ImageName        : Windows Server 2012 R2 Datacenter (Server Core Installation)
    ImageDescription : This option (recommended) reduces management and servicing by installing only what is needed to run most server roles and applications.It does not include a GUI, but you can fully manage the server locally or remotely with Windows 
                       PowerShell or other tools. You can switch to a different installation option later. See "Windows Server Installation Options."
    ImageSize        : 6,673,026,597 bytes
    
    ImageIndex       : 4
    ImageName        : Windows Server 2012 R2 Datacenter (Server with a GUI)
    ImageDescription : This option is useful when a GUI is required—for example, to provide backward compatibility for an application that cannot be run on a Server Core installation. All server roles and features are supported. You can switch to a different 
                       installation option later. See "Windows Server Installation Options."
    ImageSize        : 11,820,847,585 bytes
    
    PS> 

    Sunday, August 4, 2019 7:24 AM
  • This is a PowerShell issue.

    When I connect the ISO file to a Win 2012R2  or a  Win 2016 computer I have this output :

    PS> Get-WindowsImage -ImagePath Z:\sources\install.wim
    
    
    Index       : 1
    Name        : Windows Server 2019 SERVERSTANDARDCORE
    Description : Windows Server 2019 SERVERSTANDARDCORE
    Size        : 8 092 332 038 bytes
    
    Index       : 2
    Name        : Windows Server 2019 SERVERSTANDARD
    Description : Windows Server 2019 SERVERSTANDARD
    Size        : 14 308 216 364 bytes
    
    Index       : 3
    Name        : Windows Server 2019 SERVERDATACENTERCORE
    Description : Windows Server 2019 SERVERDATACENTERCORE
    Size        : 8 081 038 156 bytes
    
    Index       : 4
    Name        : Windows Server 2019 SERVERDATACENTER
    Description : Windows Server 2019 SERVERDATACENTER
    Size        : 14 312 166 767 bytes
    
    PS>

    When I connect the ISO file to a Win 2019 computer I have this output :

    PS> Get-WindowsImage -ImagePath Z:\sources\install.wim
    
    ImageIndex       : 1
    ImageName        : Windows Server 2019 Standard
    ImageDescription : (Recommended) This option omits most of the Windows graphical environment. Manage with a command prompt and PowerShell, or remotely with Windows Admin Center or other tools.
    ImageSize        : 8,092,332,038 bytes
    
    ImageIndex       : 2
    ImageName        : Windows Server 2019 Standard (Desktop Experience)
    ImageDescription : This option installs the full Windows graphical environment, consuming extra drive space. It can be useful if you want to use the Windows desktop or have an app that requires it.
    ImageSize        : 14,308,216,364 bytes
    
    ImageIndex       : 3
    ImageName        : Windows Server 2019 Datacenter
    ImageDescription : (Recommended) This option omits most of the Windows graphical environment. Manage with a command prompt and PowerShell, or remotely with Windows Admin Center or other tools.
    ImageSize        : 8,081,038,156 bytes
    
    ImageIndex       : 4
    ImageName        : Windows Server 2019 Datacenter (Desktop Experience)
    ImageDescription : This option installs the full Windows graphical environment, consuming extra drive space. It can be useful if you want to use the Windows desktop or have an app that requires it.
    ImageSize        : 14,312,166,767 bytes
    
    PS>

    Solution: Connect or mount the ISO file to a Win 2016 or earlier in order to get the right image names.

    Sunday, August 4, 2019 7:56 AM