Skip to content

Commit b1d4eb0

Browse files
Fix mount disk error (#4204)
* wait for mounting to assign disk letter * update * Gabi fixing my slop with a comment
1 parent 3dbd993 commit b1d4eb0

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

functions/private/Invoke-WinUtilISO.ps1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,13 @@ function Invoke-WinUtilISOMountAndVerify {
4949
Set-WinUtilProgressBar -Label "Mounting ISO..." -Percent 10
5050

5151
try {
52-
$diskImage = Mount-DiskImage -ImagePath $isoPath -PassThru -ErrorAction Stop
53-
$driveLetter = ($diskImage | Get-Volume).DriveLetter + ":"
52+
Mount-DiskImage -ImagePath $isoPath -ErrorAction Stop | Out-Null
53+
54+
do {
55+
Start-Sleep -Milliseconds 500
56+
} until ((Get-DiskImage -ImagePath $isoPath | Get-Volume).DriveLetter)
57+
58+
$driveLetter = (Get-DiskImage -ImagePath $isoPath | Get-Volume).DriveLetter + ":"
5459
Write-Win11ISOLog "Mounted at drive $driveLetter"
5560

5661
Set-WinUtilProgressBar -Label "Verifying ISO contents..." -Percent 30

0 commit comments

Comments
 (0)