|Microsoft Deployment Toolkit
Automating the Application of Operating System Service Packs Using a Reference Computer and Windows PowerShell
You can automate the process of updating operating system service packs using Windows PowerShell when you have only the service pack that is not yet integrated with the operating system, such as having SP1 for Windows 7 not yet integrated with a Windows 7 image.
For this method, deploy the operating system without the service pack to a reference computer. Then, apply the service pack to the reference computer. Next, capture an operating system image of the reference computer. Finally, copy the captured .wim file over the Install.wim file in the operating system in the deployment share using Windows PowerShell.
To automate the application of operating system service packs from updates source media using Windows PowerShell
1. Deploy the target operating system to a reference computer.
For more information on how to deploy a reference computer, see the following resources in the MDT document, Using the Microsoft Deployment Toolkit:
2. Install the desired service pack to the reference computer.
For more information on how to install the service pack, see the documentation accompanying the service pack.
3. Capture an image of the reference computer by creating and deploying a task sequence based on the Sysprep and Capture task sequence template.
For more information about creating a task sequence based on the Sysprep and Capture task sequence template, see Create a New Task Sequence in the Deployment Workbench.
4. Load the MDT Windows PowerShell snap-in as described in Loading the MDT Windows PowerShell Snap-In.
5. Ensure the MDT deployments that share Windows PowerShell drives are restored using the Restore-MDTPersistentDrive cmdlet, as shown in the following example:
Note If the MDT deployments that share Windows PowerShell drives are already restored, you will receive a warning message indicating that the cmdlet is unable to restore the drive.
6. View the list of MDT deployments share Windows PowerShell drives, one for each deployment share, using the Get-PSDrive cmdlet, as shown in the following example:
Get-PSDrive -PSProvider Microsoft.BDD.PSSnapIn\MDTProvider
The list of Windows PowerShell drives provided using the MDTProvider are listed, one for each deployment share.
7. Copy the .wim file captured in step 3 over the Install.wim file in the operating system in the deployment share using the Copy-Item cmdlet, as shown in the following example:
Copy-Item "DS002:\Captures\Win7SP1.wim" -Destination "DS002:\Operating Systems\Windows 7\sources\Install.wim" ‑Force
In this example, the captured operating system image file (Win7SP1.wim) in the Captures folder in the share DS002: is the name of a Windows PowerShell drive returned in step 6, and the existing Windows 7 operating system is stored in folder named Windows 7.
8. Update any MDT deployment media based on deployment share using Update-MDTMedia cmdlet.
For more information about how to update MDT deployment media based on deployment share using Update-MDTMedia cmdlet, see Updating Deployment Media Using Windows PowerShell.