From c58b11e178e7a08dcb22097739034a21d7a2bfbb Mon Sep 17 00:00:00 2001 From: xrgzs Date: Tue, 30 Apr 2024 14:26:43 +0800 Subject: [PATCH] close select 1 edition only --- msupdate.ps1 | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/msupdate.ps1 b/msupdate.ps1 index 8993020..8b784f4 100644 --- a/msupdate.ps1 +++ b/msupdate.ps1 @@ -211,19 +211,19 @@ if ($?) {Write-Host "System Image Download Successfully!"} else {Write-Error "Sy ."C:\Program Files\7-Zip\7z.exe" x ".\temp\$osfile" -o".\ISO" -r # select 1 edition only -if ($null -ne $SelectEdition) { - .\bin\wimlib-imagex.exe info ".\ISO\sources\install.wim" --extract-xml ".\temp\WIMInfo.xml" - $WIMInfo = [xml](Get-Content ".\temp\WIMInfo.xml") - $WIMIndex = $WIMInfo.WIM.IMAGE | Where-Object {$_.WINDOWS.EDITIONID -eq "$SelectEdition"} | Select-Object -ExpandProperty INDEX - $WIMIndexs = $WIMInfo.WIM.IMAGE.Index | Measure-Object | Select-Object -ExpandProperty Count - 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 - } -} +# if ($null -ne $SelectEdition) { +# .\bin\wimlib-imagex.exe info ".\ISO\sources\install.wim" --extract-xml ".\temp\WIMInfo.xml" +# $WIMInfo = [xml](Get-Content ".\temp\WIMInfo.xml") +# $WIMIndex = $WIMInfo.WIM.IMAGE | Where-Object {$_.WINDOWS.EDITIONID -eq "$SelectEdition"} | Select-Object -ExpandProperty INDEX +# $WIMIndexs = $WIMInfo.WIM.IMAGE.Index | Measure-Object | Select-Object -ExpandProperty Count +# 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 +# } +# } .\bin\wimlib-imagex.exe info ".\ISO\sources\install.wim" --extract-xml ".\temp\WIMInfo2.xml" Get-Content ".\temp\WIMInfo2.xml"