|
|
本帖最后由 ilikeyi 于 2025-12-21 13:40 编辑
这是提取 Install.wim 里的 WinRE.wim ,自己研究下改改吧。
- ForEach ($item in $Global:Primary_Key_Image.Index) {
- if ($Script:Wimlib_Select_Index -Contains $item.ImageIndex) {
- Write-Host " $($lang.MountedIndex): " -NoNewline
- Write-Host $item.ImageIndex -ForegroundColor Yellow
- Write-Host " $($lang.Wim_Image_Name): " -NoNewline
- Write-Host $item.ImageName -ForegroundColor Yellow
- Write-Host " $($lang.Wim_Image_Description): " -NoNewline
- Write-Host $item.ImageDescription -ForegroundColor Yellow
- Write-Host " $($lang.Wim_Display_Name): " -NoNewline
- Write-Host $item.DISPLAYNAME -ForegroundColor Yellow
- Write-Host " $($lang.Wim_Display_Description): " -NoNewline
- Write-Host $item.DISPLAYDESCRIPTION -ForegroundColor Yellow
- $wimlib = "$(Get_Arch_Path -Path "$($PSScriptRoot)\..\..\..\..\AIO\wimlib")\wimlib-imagex.exe"
- if (Test-Path -Path $wimlib -PathType Leaf) {
- <#
- .创建保存到位置目录
- #>
- $RandomGuid = [guid]::NewGuid()
- $Local_Wim_Update_Folder_Sources = "$($UI_Main_Mask_Report_Save_To.Text)\$($RandomGuid)"
- Check_Folder -chkpath $Local_Wim_Update_Folder_Sources
- Start-Process -FilePath $wimlib -ArgumentList "extract ""$($Global:Primary_Key_Image.FullPath)"" $($item.ImageIndex) ""$($WimLib_SplieNew_Rule_path[2])"" --dest-dir=""$($Local_Wim_Update_Folder_Sources)""" -wait -WindowStyle Minimized
- $FullFilePath = "$($Local_Wim_Update_Folder_Sources)\WinRE.wim"
- if (Test-Path -Path $FullFilePath -PathType Leaf) {
- Rename-Item -Path "$($Local_Wim_Update_Folder_Sources)\WinRE.wim" -NewName "$($Local_Wim_Update_Folder_Sources)\Index.$($item.ImageIndex).$($item.ImageName).WinRe.wim" -ErrorAction SilentlyContinue
- }
- <#
- .刷新
- #>
- Wimlib_Image_Refresh_Sources_Rule -Guid $RandomGuid
- } else {
- Write-Host " $($lang.Inoperable)`n" -ForegroundColor Red
- }
- }
- }
复制代码
|
|