I came across a nifty PowerShell module today. The Module can be found here: http://windowsitpro.com/windows/add-updates-offline-vhd-or-wim-file
It’s an automation of the offline servicing of a VHD(X) or WIM file.
If (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator"))
$Arguments = "& '" + $myinvocation.mycommand.definition + "'"
Start-Process powershell -Verb runAs -ArgumentList $Arguments
Install-Patch <Path/share to vhdx file> "<Path/Share to SCCM/WSUS Windows 2012 updates>"
This script I put in my task scheduler to run weekly, specifying the location of my VHDX file which I use to deploy servers from… This way my main VHD file always contains the latest updates when I deploy a new server from this VHD.
The script will first check if it has been ran as administrator, if not, it’ll restart the script and execute and apply all updates the system doesn’t contain (yet) and uses your SCCM/WSUS share (thus automatically uses its settings and rules for update deployment)