mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2024-12-31 18:24:27 -06:00
Improve detection for Professional editions
This commit is contained in:
parent
6d4db7dc7a
commit
744fee6c40
@ -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)'....."
|
||||
|
||||
|
14
winutil.ps1
14
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)'....."
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user