mirror of
https://github.com/rbalsleyMSFT/FFU.git
synced 2026-06-14 02:09:35 -06:00
Fix issue with single index wims that don't have a 4th index
This commit is contained in:
@@ -892,9 +892,15 @@ function Get-Index {
|
|||||||
# Get the available indexes using Get-WindowsImage
|
# Get the available indexes using Get-WindowsImage
|
||||||
$imageIndexes = Get-WindowsImage -ImagePath $WindowsImagePath
|
$imageIndexes = Get-WindowsImage -ImagePath $WindowsImagePath
|
||||||
|
|
||||||
# Get the ImageName of ImageIndex 4 - this is usually Home or Education SKU on ESD MCT media
|
# Get the ImageName of ImageIndex 1 if an ISO was specified, else use ImageIndex 4 - this is usually Home or Education SKU on ESD MCT media
|
||||||
$imageIndex4 = $imageIndexes | Where-Object ImageIndex -eq 4
|
if($ISOPath){
|
||||||
$WindowsImage = $imageIndex4.ImageName.Substring(0, 10)
|
$imageIndex = $imageIndexes | Where-Object ImageIndex -eq 1
|
||||||
|
$WindowsImage = $imageIndex.ImageName.Substring(0, 10)
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$imageIndex = $imageIndexes | Where-Object ImageIndex -eq 4
|
||||||
|
$WindowsImage = $imageIndex.ImageName.Substring(0, 10)
|
||||||
|
}
|
||||||
|
|
||||||
# Concatenate $WindowsImage and $WindowsSKU (E.g. Windows 11 Pro)
|
# Concatenate $WindowsImage and $WindowsSKU (E.g. Windows 11 Pro)
|
||||||
$ImageNameToFind = "$WindowsImage $WindowsSKU"
|
$ImageNameToFind = "$WindowsImage $WindowsSKU"
|
||||||
|
|||||||
Reference in New Issue
Block a user