Skip to content

Commit

Permalink
Update Invoke-WPFGetIso.ps1
Browse files Browse the repository at this point in the history
Move output outside of for loop
  • Loading branch information
CodingWonders committed Nov 6, 2024
1 parent 8ac72dc commit 5786fcd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions functions/public/Invoke-WPFGetIso.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -263,16 +263,16 @@ function Invoke-WPFGetIso {

$images = Get-WindowsImage -ImagePath $wimFile

$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."

# Populate the list of Windows flavors and find the Pro edition
$images | ForEach-Object {
$imageIdx = $_.ImageIndex
$imageName = $_.ImageName

$sync.MicrowinWindowsFlavors.Items.Add("$imageIdx : $imageName")

$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."

if ((Get-WindowsImage -ImagePath $wimFile -Index $_.ImageIndex).EditionId -eq "Professional") {
# We have found the Pro edition
$sync.MicrowinWindowsFlavors.SelectedIndex = $_.ImageIndex - 1
Expand Down

0 comments on commit 5786fcd

Please sign in to comment.