Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Directly use index if Edition fits exactly #29

Open
bezik46 opened this issue Jan 22, 2022 · 6 comments
Open

Directly use index if Edition fits exactly #29

bezik46 opened this issue Jan 22, 2022 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@bezik46
Copy link

bezik46 commented Jan 22, 2022

In command I have: -Edition "Windows Server 2022 SERVERSTANDARD"

Yet output shows:

Windows(R) Image to Virtual Hard Disk Converter for Windows(R)
Copyright (C) Microsoft Corporation.  All rights reserved.
Copyright (C) 2019 x0nn
Version 10.0.14278.1000.amd64fre.rs1_es_media.160201-1707

WARNING: 2022-01-22T08:16:22 [SP-P-MEDIA] The following images are in the image:
WARNING: 2022-01-22T08:16:22 [SP-P-MEDIA] Name: "Windows Server 2022 SERVERSTANDARDCORE" (Index: 1)
WARNING: 2022-01-22T08:16:22 [SP-P-MEDIA] Name: "Windows Server 2022 SERVERSTANDARD" (Index: 2)
Write-LogMessage : 2022-01-22T08:16:22 [SP-P-MEDIA] There is more than one WindowsImage (Edition) available. Choose
with -Edition using Name oder Index from the list above.
At C:\Convert-WindowsImage.ps1:2394 char:13
+             Write-LogMessage $_ -logType Error
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Write-LogMessage
@bezik46
Copy link
Author

bezik46 commented Jan 22, 2022

Line 1848

Adjust, so it reads:

{$_.ImageName -ilike "*$($Edition)"}

Remove the second asterix * after Edition

@x0nn x0nn self-assigned this Jan 26, 2022
@x0nn x0nn changed the title Index issue Directly use index if Edition fits exactly Jan 26, 2022
@x0nn x0nn added the enhancement New feature or request label Jan 26, 2022
@x0nn
Copy link
Owner

x0nn commented Jan 26, 2022

I will add the code to check if the Edition-string fits exactly. You can use the index for now.

@bezik46
Copy link
Author

bezik46 commented Jan 29, 2022

I could not figure out what it accepted as Index (because the number or the name was not accepted)

@x0nn
Copy link
Owner

x0nn commented Jan 31, 2022

Did you try:

-Edition 1 for example?

@bezik46
Copy link
Author

bezik46 commented Feb 2, 2022

Sure, could not find combination that got accepted

@NielsS79
Copy link

NielsS79 commented Jun 8, 2022

Can confirm that using -Edition [int] will in fact select the correct edition. I used it with -Edition 6, see the log below.

VERBOSE: 2022-06-08T08:03:20 [HOSTNAME] Looking for the requested Windows image in the WIM/ESD file...
VERBOSE: 2022-06-08T08:03:24 [HOSTNAME] Image 6 selected "Windows 11 Pro"
VERBOSE: 2022-06-08T08:03:24 [HOSTNAME] Creating sparse disk...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants