Skip to content

Commit

Permalink
Improve detection for Professional editions
Browse files Browse the repository at this point in the history
  • Loading branch information
CodingWonders committed Feb 2, 2024
1 parent 6d4db7d commit 744fee6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
10 changes: 9 additions & 1 deletion functions/public/Invoke-WPFGetIso.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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)'....."

Expand Down
14 changes: 11 additions & 3 deletions winutil.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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)'....."

Expand Down

0 comments on commit 744fee6

Please sign in to comment.