From 59ecb95a3fcda7f73dc76245f3e35871c6077522 Mon Sep 17 00:00:00 2001 From: xrgzs Date: Fri, 26 Apr 2024 13:03:37 +0800 Subject: [PATCH] for --- msupdate.ps1 | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/msupdate.ps1 b/msupdate.ps1 index 46473dc..e44946d 100644 --- a/msupdate.ps1 +++ b/msupdate.ps1 @@ -80,13 +80,12 @@ if ($?) {Write-Host "System Image Download Successfully!"} else {Write-Error "Sy $WIMInfo = [xml](Get-Content ".\temp\WIMInfo.xml") $WIMIndex = $WIMInfo.WIM.IMAGE | Where-Object {$_.WINDOWS.EDITIONID -eq "Professional"} | Select-Object -ExpandProperty INDEX $WIMIndexs = $WIMInfo.WIM.IMAGE.Index | Measure-Object | Select-Object -ExpandProperty Count -$remainingImages = $WIMIndexs -for ($i = 1; $i -le $remainingImages; $i++) { - if ($i -ne $WIMIndex) { - # .\bin\wimlib-imagex.exe delete ".\ISO\sources\install.wim" $i --soft - Remove-WindowsImage -ImagePath ".\ISO\sources\install.wim" -Index $i - $remainingImages-- - } +for ($i = $WIMIndexs; $i -gt $WIMIndex; $i--) { + # .\bin\wimlib-imagex.exe delete ".\ISO\sources\install.wim" $i --soft + Remove-WindowsImage -ImagePath ".\ISO\sources\install.wim" -Index $i +} +for ($i = 1; $i -lt $WIMIndex; $i++) { + Remove-WindowsImage -ImagePath ".\ISO\sources\install.wim" -Index 1 } # write W10UI conf