From 853a142052e5f961a462c7a92fde7df9a037d39d Mon Sep 17 00:00:00 2001 From: CodingWonders <101426328+CodingWonders@users.noreply.github.com> Date: Wed, 31 Dec 2025 16:40:37 +0100 Subject: [PATCH] Revert "Update Invoke-Microwin.ps1 (#15)" This reverts commit 88f8a3031b2eb350b150eb04c7c4ffee428b0414. --- functions/microwin/Invoke-Microwin.ps1 | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/functions/microwin/Invoke-Microwin.ps1 b/functions/microwin/Invoke-Microwin.ps1 index 80cb1583..06d678f6 100644 --- a/functions/microwin/Invoke-Microwin.ps1 +++ b/functions/microwin/Invoke-Microwin.ps1 @@ -432,29 +432,9 @@ public class PowerManagement { Write-Host "Cleanup complete." Write-Host "Unmounting image..." - $retryCount = 0 - $unmounted = $false - $logPath = "$env:LOCALAPPDATA\winutil\logs" - - while ($retryCount -lt 4 -and -not $unmounted) { - try { - Dismount-WindowsImage -Path "$scratchDir" -Save -ErrorAction Stop - $unmounted = $true - } catch { - $retryCount++ - Write-Warning "Unmount failed (Attempt $retryCount of 4). Retrying in 5 seconds..." - Start-Sleep -Seconds 5 - } - } - - if (-not $unmounted) { - $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" - Write-Error $msg - Invoke-MicrowinBusyInfo -action "warning" -message "Unmount Failed" - Set-WinUtilTaskbaritem -state "Error" -value 1 -overlay "warning" - return - } + Dismount-WindowsImage -Path "$scratchDir" -Save } + try { Write-Host "Exporting image into $mountDir\sources\install2.wim"