mirror of
https://github.com/rbalsleyMSFT/FFU.git
synced 2026-06-14 02:09:35 -06:00
Merge branch '2405.1' into feature-reduce-ffu-size
This commit is contained in:
@@ -15,9 +15,6 @@ del c:\windows\panther\unattend\unattend.xml /F /Q
|
|||||||
del c:\windows\panther\unattend.xml /F /Q
|
del c:\windows\panther\unattend.xml /F /Q
|
||||||
taskkill /IM sysprep.exe
|
taskkill /IM sysprep.exe
|
||||||
timeout /t 10
|
timeout /t 10
|
||||||
REM Run Component Cleanup since dism /online /cleanup-image /analyzecomponentcleanup recommends it
|
|
||||||
REM If adding latest CU, definitely need to do this to keep FFU size smaller
|
|
||||||
dism /online /cleanup-image /startcomponentcleanup /resetbase
|
|
||||||
REM Run disk cleanup (cleanmgr.exe) with all options enabled: https://learn.microsoft.com/en-us/troubleshoot/windows-server/backup-and-storage/automating-disk-cleanup-tool
|
REM Run disk cleanup (cleanmgr.exe) with all options enabled: https://learn.microsoft.com/en-us/troubleshoot/windows-server/backup-and-storage/automating-disk-cleanup-tool
|
||||||
set rootkey=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches
|
set rootkey=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches
|
||||||
REM Per above doc, the Offline Pages Files subkey does not have stateflags value
|
REM Per above doc, the Offline Pages Files subkey does not have stateflags value
|
||||||
|
|||||||
@@ -2265,10 +2265,13 @@ try {
|
|||||||
if ($UpdateLatestCU -or $UpdateLatestNet) {
|
if ($UpdateLatestCU -or $UpdateLatestNet) {
|
||||||
try {
|
try {
|
||||||
WriteLog "Adding KBs to $WindowsPartition"
|
WriteLog "Adding KBs to $WindowsPartition"
|
||||||
Add-WindowsPackage -Path $WindowsPartition -PackagePath $KBPath | Out-Null
|
Add-WindowsPackage -Path $WindowsPartition -PackagePath $KBPath -PreventPending | Out-Null
|
||||||
WriteLog "KBs added to $WindowsPartition"
|
WriteLog "KBs added to $WindowsPartition"
|
||||||
WriteLog "Removing $KBPath"
|
WriteLog "Removing $KBPath"
|
||||||
Remove-Item -Path $KBPath -Recurse -Force | Out-Null
|
Remove-Item -Path $KBPath -Recurse -Force | Out-Null
|
||||||
|
WriteLog "Clean Up the WinSxS Folder"
|
||||||
|
Dism /Image:$WindowsPartition /Cleanup-Image /StartComponentCleanup /ResetBase | Out-Null
|
||||||
|
WriteLog "Clean Up the WinSxS Folder completed"
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
Write-Host "Adding KB to VHDX failed with error $_"
|
Write-Host "Adding KB to VHDX failed with error $_"
|
||||||
|
|||||||
Reference in New Issue
Block a user