Fix mount disk error (#4204)

* wait for mounting to assign disk letter

* update

* Gabi fixing my slop with a comment
This commit is contained in:
Chris Titus
2026-03-12 15:45:42 -05:00
committed by GitHub
parent 3dbd993cb4
commit b1d4eb022c

View File

@@ -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