A few days ago, my Win10.guru partner Ed shared a link with me, saying he was sure I’ll find it interesting: Deploying fully patched Windows 10 computers: A guide for IT pros. He was right, of course. I saved it in both Favorites and in OneNote. One of the methods described in that story uses something called OSDBuilder:
OSDBuilder is a PowerShell module to help you perform Offline Servicing to a Windows Operating System Image. By using an Offline method of configuring an Operating System, it can then be imported in MDT or SCCM and used like any other OS Deployment. This includes being able to use it in an Upgrade Task Sequence, which you cannot do with a Captured Image.
I use patched, fully updated but otherwise unmodified default Windows 10 images when building custom deployment images on reference machines. One reason is that when Windows Update does not need to download and install anything when customizing Windows 10 in Audit Mode, the more sure I can be that no app provisioning errors will cause generalizing the image with Sysprep to fail. Usually I download all updates from Microsoft Update Catalog website, and use DISM to apply them to default W10 image: DISM: Install a CAB Package for Windows Update
I had tested OSDBuilder earlier, but only a few times to see what it could do. Reading the article I mentioned earlier, I decided to check how easy it might be to totally automate the process of patching an ISO using that tool. To my surprise, the only thing I needed was a five line PowerShell script. But first, the OSDBuilder module had to be installed and imported into PowerShell. Notice that both the Windows 10 ADK and the WinPE add-on for ADK must be installed before installing OSDBuilder, and that the PowerShell execution policy must be set to Bypass, Remote Signed or Unrestricted.
To install OSDBuilder, enter the following command in an elevated PowerShell:
Now, import it into PowerShell:
When that was done, I mounted the Windows 10 version 1909 ISO on my host machine. I then wrote a simple five-line, five cmdlet script using the PS ISE Script Editor, pressed F5 to run it, and the new patched image was created automatically. Here’s that very script:
Get-OSDBuilder -SetPath G:\Images Get-OSBuilder -CreatePaths Import-OSMedia -Update Get-DownOSDBuilder -ContentDownload ‘OneDriveSetup Production’ New-OSBMediaISO
The first cmdlet sets the working path to the Images folder on my deployment image drive G:. Line 2 creates the folder structure in that G:\Images, and line 3 automatically detects the mounted Windows 10 ISO image and imports it. For a multi edition ISO, the user is asked to select some particular edition:
When the OS has been imported, OSDBuilder will then download and install any pending patches.
Line 4 updates the OneDrive Setup. This is an important step, to assure that OD for Business will function normally. Finally, the last cmdlet writes a patched Windows 10 ISO image, first asking which of the images, the original or the patched one, that I wish to use. In my case, build 18363.418 was patched to .628. I select that item, then click OK:
That’s it. Excluding two prompts asking the user to make a selection, everything was automated and required no other user interaction.
Notice that as I use patched but otherwise unmodified images in installing Windows on reference machines, this simple procedure is all I need. However, you can do a lot more with OSDBuilder. For a complete list of its many features and commands, please check the official website.
Author: Kari Finn
A former Windows Insider MVP, Kari started in computing in the mid 80’s writing code for VAX / VMS systems. Since then, he’s worked in a variety of IT positions. He specializes in Windows image capture, customization, repair and deployment as well as Hyper-V virtualization. Kari is a proud Team Member at number #1 Windows site TenForums.com.