Offline servicing windows 10 Applying Windows Updates to a base WIM using DISM and Powershell
Windows 10 WIM using DISM
Manual installation
Firstly, locate your most up to date image and make a copy of it. This is so we can
stream the newest Windows Updates into the mounted WIM without risk of damaging
a working WIM. I suggest copying the WIM to a temp location. Also, put the
Windows Update that you want to apply into an Updates folder.
stream the newest Windows Updates into the mounted WIM without risk of damaging
a working WIM. I suggest copying the WIM to a temp location. Also, put the
Windows Update that you want to apply into an Updates folder.
Next, mount your image in the temp location.
DISM /Mount-Wim /WimFile:C:TempMountinstall.wim /index:1 /Mountdir:C:TempMountMount
Now inject the Windows Update you need to apply
DISM /image:C:TempMountMount /Add-Package /Packagepath:C:Updates
Finally, save an unmount the image
DISM /Unmount-Wim /Mountdir:C:TempMountMount /commit
DISM /Cleanup-Wim
Automating the installation
While running updates manually like this is an easy way to apply a few updates, hundreds of updates require more work. Heres how you would apply the updates using PowerShell.
$UpdatesPath = "C:Updates*"
$MountPath = C:TempMountMount
$WimFile = C:TempMountinstall.wim
DISM Mount-Wim /WimFile:$WimFile /index:1 /Mountdir:$MountPath
$UpdateArray = Get-Item $UpdatesPath
ForEach ($Updates in $UpdateArray)
{
DISM /image:$MountPath /Add-Package /Packagepath:$Updates
Start-Sleep s 10
}
Write-Host "Updates Applied to WIM"
DISM /Unmount-Wim /Mountdir:$MountPath /commit
DISM /Cleanup-Wim
alternative link download