Slipstream Windows Updates

Slipstream Windows Updates

I found that I was still missing 70+ updates after downloading updates with wsusofflineupdater so I manually downloaded them from the update catalog and added them in. 


Powershell Script for slipstreaming updates (https://www.reddit.com/r/sysadmin/comments/4ak3h7/powershell_script_to_slipstream_windows_updates/)

cls

#This is the path to your latest DISM version. DISM 10 is required to slipstream Windows 10.
$DISMPath = "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\DISM\DISM.exe"

#This is any path that has enough hard disk space to mount the image and slipstream updates into it.
$MountPath = “D:\TempMount\mount”

#Update the paths below as necessary to point to your Windows Updates folders.
$UpdatesPath1 = "D:\WU\wsusoffline105\wsusoffline\client\w61-x64\glb\*"
$UpdatesPath2 = "D:\WU\wsusoffline105\wsusoffline\client\w63-x64\glb\*"
$UpdatesPath3 = "D:\WU\wsusoffline105\wsusoffline\client\w100-x64\glb\*"

#Update the paths below to point to your "install.wim" locations.
$WimFile1 = “D:\DeploymentShare\Operating Systems\Windows 7 x64\sources\install.wim”
$WimFile2 = “D:\DeploymentShare\Operating Systems\Windows 8.1 Enterprise x64\sources\install.wim”
$WimFile3 = “D:\DeploymentShare\Operating Systems\Windows 10 Enterprise x64 1511\sources\install.wim”
$WimFile4 = “D:\DeploymentShare\Operating Systems\Windows Server 2008 R2 x64\sources\install.wim”
$WimFile5 = “D:\DeploymentShare\Operating Systems\Windows Server 2012 R2 SERVERSTANDARDCORE x64\sources\install.wim”

Do {

    #Cleanup any existing images that may already be mounted.
    &$DISMPath /Cleanup-Wim

    #Prompt user for choice of OS or to exit.
    Write-Host ""
    Write-Host "Windows Update Slipstream into Deployment Files"
    Write-Host "1 - Windows 7 SP1 x64"
    Write-Host "2 - Windows 8.1 x64"
    Write-Host "3 - Windows 10 1511 x64"
    Write-Host "4 - Windows Server 2008 R2 SP1"
    Write-Host "5 - Windows Server 2012 R2"
    Write-Host "0 - Exit"

    $Choice = Read-Host -Prompt 'Select an Operating System to Update'

    #Based on user's input above, update the variables to select the correct image and update file path.
    If ($Choice -eq "1")
        {
        Write-Host "Please stand by, this can take a while depending on the number of updates."
        Write-Host "Slipstreaming updates to Windows 7 SP1 x64..."
        $WimFile = $WimFile1
        $UpdatesPath = $UpdatesPath1
        }
        elseif ($Choice -eq "2")
            {
            Write-Host "Please stand by, this can take a while depending on the number of updates."
            Write-Host "Slipstreaming updates to Windows 8.1 x64..."
            $WimFile = $WimFile2
            $UpdatesPath = $UpdatesPath2
            }
        elseif ($Choice -eq "3")
            {
            Write-Host "Please stand by, this can take a while depending on the number of updates."
            Write-Host "Slipstreaming updates to Windows 10 1511 x64..."
            $WimFile = $WimFile3
            $UpdatesPath = $UpdatesPath3
            }
        elseif ($Choice -eq "4")
            {
            Write-Host "Please stand by, this can take a while depending on the number of updates."
            Write-Host "Slipstreaming updates to Windows Server 2008 R2 SP1..."
            $WimFile = $WimFile4
            $UpdatesPath = $UpdatesPath1
            }
        elseif ($Choice -eq "5")
            {
            Write-Host "Please stand by, this can take a while depending on the number of updates."
            Write-Host "Slipstreaming updates to Windows Server 2012 R2..."
            $WimFile = $WimFile5
            $UpdatesPath = $UpdatesPath2
            }
        elseif ($Choice -eq "0")
            {
            Write-Host "Exiting..."
            break
            }
    
    #Mount the image in the temporyar mount path specified above.
    &$DISMPath /Mount-Wim /WimFile:$WimFile /index:1 /Mountdir:$MountPath
    
    #Apply the patches and show progress.
    &$DISMPath /image:$MountPath /Add-Package /Packagepath:$UpdatesPath

    Write-Host "Updates Applied to WIM, scroll up to check for any errors encountered."

    #Commit changes to image that is currently mounted in the temporary mount path and write to disk.
    &$DISMPath /Unmount-Wim /Mountdir:$MountPath /commit

    #Clean up any mounted images.
    &$DISMPath /Cleanup-Wim

  }

#Return to the menu and wait on user input.
while ($Choice -ne "0")

Leave a Reply

Your email address will not be published. Required fields are marked *