From b1d4eb022c259a4860f60de88c883136d7d1f45e Mon Sep 17 00:00:00 2001 From: Chris Titus Date: Thu, 12 Mar 2026 15:45:42 -0500 Subject: [PATCH] Fix mount disk error (#4204) * wait for mounting to assign disk letter * update * Gabi fixing my slop with a comment --- functions/private/Invoke-WinUtilISO.ps1 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/functions/private/Invoke-WinUtilISO.ps1 b/functions/private/Invoke-WinUtilISO.ps1 index db7ed1ab..5ef5798c 100644 --- a/functions/private/Invoke-WinUtilISO.ps1 +++ b/functions/private/Invoke-WinUtilISO.ps1 @@ -49,8 +49,13 @@ function Invoke-WinUtilISOMountAndVerify { Set-WinUtilProgressBar -Label "Mounting ISO..." -Percent 10 try { - $diskImage = Mount-DiskImage -ImagePath $isoPath -PassThru -ErrorAction Stop - $driveLetter = ($diskImage | Get-Volume).DriveLetter + ":" + Mount-DiskImage -ImagePath $isoPath -ErrorAction Stop | Out-Null + + do { + Start-Sleep -Milliseconds 500 + } until ((Get-DiskImage -ImagePath $isoPath | Get-Volume).DriveLetter) + + $driveLetter = (Get-DiskImage -ImagePath $isoPath | Get-Volume).DriveLetter + ":" Write-Win11ISOLog "Mounted at drive $driveLetter" Set-WinUtilProgressBar -Label "Verifying ISO contents..." -Percent 30