ISO: Adding a WIM

OSD 23.5.23.1+ Updated May 23, 2023

In this example, I am going to show you how to add a WIM to an ISO for deployment with OSDCloud.

OSDCloud Workspace

You probably have your own OSDCloud Workspace already configured, but I'm sharing what I'm doing for this demo, so hopefully you'll learn something new

#Set your OSDCloud Template
Set-OSDCloudTemplate -Name 'WinPE KB5026372'

#Create a new OSDCloud Workspace
New-OSDCloudWorkspace -WorkspacePath D:\Demo\OSDCloud\CustomImage

#Cleanup OSDCloud Workspace Media
$KeepTheseDirs = @('boot','efi','en-us','sources','fonts','resources')
Get-ChildItem D:\Demo\OSDCloud\CustomImage\Media | Where {$_.PSIsContainer} | Where {$_.Name -notin $KeepTheseDirs} | Remove-Item -Recurse -Force
Get-ChildItem D:\Demo\OSDCloud\CustomImage\Media\Boot | Where {$_.PSIsContainer} | Where {$_.Name -notin $KeepTheseDirs} | Remove-Item -Recurse -Force
Get-ChildItem D:\Demo\OSDCloud\CustomImage\Media\EFI\Microsoft\Boot | Where {$_.PSIsContainer} | Where {$_.Name -notin $KeepTheseDirs} | Remove-Item -Recurse -Force

#Edit WinPE and rebuild ISO
Edit-OSDCloudWinPE -UseDefaultWallpaper

Windows Image

For my Windows Image, I'm just going to grab one from OSDBuilder. In this case I am going to just Copy as Path

I can now copy the Windows Image to my OSDCloud Workspace and rebuild the ISO

$WindowsImage = "D:\OSDBuilder\OSMedia\Windows 11 Enterprise x64 22H2 22621.674\OS\sources\install.wim"
$Destination = "$(Get-OSDCloudWorkspace)\Media\OSDCloud\OS"
New-Item -Path $Destination -ItemType Directory -Force
Copy-Item -Path $WindowsImage -Destination "$Destination\CustomImage.wim" -Force
New-OSDCloudISO

WinPE

Now when using OSDCloudGUI, WIM files that exist on any drive letter in the <drive>:\OSDCloud\OS path are added to the Operating System combobox. In the screenshots below I have two WIM files present

Once a WIM file has been selected in the Operating System combobox, the ImageName for each Index is populated in the secondary combobox

Last updated