diff --git a/functions/public/Invoke-WPFGetIso.ps1 b/functions/public/Invoke-WPFGetIso.ps1 index 570cad74b4..6a2fa50ccd 100644 --- a/functions/public/Invoke-WPFGetIso.ps1 +++ b/functions/public/Invoke-WPFGetIso.ps1 @@ -173,7 +173,15 @@ function Invoke-WPFGetIso { $imageName = $_.ImageName $sync.MicrowinWindowsFlavors.Items.Add("$imageIdx : $imageName") } - $sync.MicrowinWindowsFlavors.SelectedIndex = 5 + $sync.MicrowinWindowsFlavors.SelectedIndex = 0 + Write-Host "Finding suitable Pro edition. This can take some time. Do note that this is an automatic process that might not select the edition you want." + Get-WindowsImage -ImagePath $wimFile | ForEach-Object { + if ((Get-WindowsImage -ImagePath $wimFile -Index $_.ImageIndex).EditionId -eq "Professional") + { + # We have found the Pro edition + $sync.MicrowinWindowsFlavors.SelectedIndex = $_.ImageIndex - 1 + } + } Get-Volume $driveLetter | Get-DiskImage | Dismount-DiskImage Write-Host "Selected value '$($sync.MicrowinWindowsFlavors.SelectedValue)'....." diff --git a/winutil.ps1 b/winutil.ps1 index 4dc821c7b3..1b55e78cad 100644 --- a/winutil.ps1 +++ b/winutil.ps1 @@ -10,7 +10,7 @@ Author : Chris Titus @christitustech Runspace Author: @DeveloperDurp GitHub : https://github.com/ChrisTitusTech - Version : 24.02.01 + Version : 24.02.02 #> param ( [switch]$Debug, @@ -47,7 +47,7 @@ Add-Type -AssemblyName System.Windows.Forms # Variable to sync between runspaces $sync = [Hashtable]::Synchronized(@{}) $sync.PSScriptRoot = $PSScriptRoot -$sync.version = "24.02.01" +$sync.version = "24.02.02" $sync.configs = @{} $sync.ProcessRunning = $false @@ -3053,7 +3053,15 @@ function Invoke-WPFGetIso { $imageName = $_.ImageName $sync.MicrowinWindowsFlavors.Items.Add("$imageIdx : $imageName") } - $sync.MicrowinWindowsFlavors.SelectedIndex = 5 + $sync.MicrowinWindowsFlavors.SelectedIndex = 0 + Write-Host "Finding suitable Pro edition. This can take some time. Do note that this is an automatic process that might not select the edition you want." + Get-WindowsImage -ImagePath $wimFile | ForEach-Object { + if ((Get-WindowsImage -ImagePath $wimFile -Index $_.ImageIndex).EditionId -eq "Professional") + { + # We have found the Pro edition + $sync.MicrowinWindowsFlavors.SelectedIndex = $_.ImageIndex - 1 + } + } Get-Volume $driveLetter | Get-DiskImage | Dismount-DiskImage Write-Host "Selected value '$($sync.MicrowinWindowsFlavors.SelectedValue)'....."