Tuesday, November 24, 2015
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:\TempMount\install.wim /index:1 /Mountdir:C:\TempMount\Mount
Now inject the Windows Update you need to apply
DISM /image:C:\TempMount\Mount /Add-Package /Packagepath:C:\Updates\
Finally, save an unmount the image
DISM /Unmount-Wim /Mountdir:C:\TempMount\Mount /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. Here’s how you would apply the updates using PowerShell.
$UpdatesPath = "C:\Updates\*"
$MountPath = “C:\TempMount\Mount”
$WimFile = “C:\TempMount\install.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
Labels:
Windows
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.