Skip to content

Commit 853a142

Browse files
committed
Revert "Update Invoke-Microwin.ps1 (#15)"
This reverts commit 88f8a30.
1 parent 88f8a30 commit 853a142

1 file changed

Lines changed: 2 additions & 22 deletions

File tree

functions/microwin/Invoke-Microwin.ps1

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -432,29 +432,9 @@ public class PowerManagement {
432432
Write-Host "Cleanup complete."
433433

434434
Write-Host "Unmounting image..."
435-
$retryCount = 0
436-
$unmounted = $false
437-
$logPath = "$env:LOCALAPPDATA\winutil\logs"
438-
439-
while ($retryCount -lt 4 -and -not $unmounted) {
440-
try {
441-
Dismount-WindowsImage -Path "$scratchDir" -Save -ErrorAction Stop
442-
$unmounted = $true
443-
} catch {
444-
$retryCount++
445-
Write-Warning "Unmount failed (Attempt $retryCount of 4). Retrying in 5 seconds..."
446-
Start-Sleep -Seconds 5
447-
}
448-
}
449-
450-
if (-not $unmounted) {
451-
$msg = "Failed to unmount image after 4 attempts. Please retry making the ISO. If this persists, create a support issue in the CTT Discord under Windows Utils and Support with the log file found at: $logPath"
452-
Write-Error $msg
453-
Invoke-MicrowinBusyInfo -action "warning" -message "Unmount Failed"
454-
Set-WinUtilTaskbaritem -state "Error" -value 1 -overlay "warning"
455-
return
456-
}
435+
Dismount-WindowsImage -Path "$scratchDir" -Save
457436
}
437+
458438
try {
459439

460440
Write-Host "Exporting image into $mountDir\sources\install2.wim"

0 commit comments

Comments
 (0)