# ISO: Adding a WIM

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

{% code overflow="wrap" lineNumbers="true" fullWidth="true" %}

```powershell
#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
```

{% endcode %}

<figure><img src="https://344220114-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MVSV22dcsjKDdOxDA6n%2Fuploads%2FEGMEv7kBvkxat3NWMmJP%2Fimage.png?alt=media&#x26;token=9c5b35ce-c23b-4cd4-8672-ab2af0a1d9d4" alt=""><figcaption></figcaption></figure>

## 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

<figure><img src="https://344220114-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MVSV22dcsjKDdOxDA6n%2Fuploads%2FIeWjZva0ABPxgFpcgxxB%2Fimage.png?alt=media&#x26;token=f952dcd8-767d-4237-960c-6866f847e5b1" alt=""><figcaption></figcaption></figure>

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

{% code overflow="wrap" lineNumbers="true" fullWidth="true" %}

```powershell
$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
```

{% endcode %}

## 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

<figure><img src="https://344220114-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MVSV22dcsjKDdOxDA6n%2Fuploads%2FME4FDDZrzaPMFOn5DDex%2Fimage.png?alt=media&#x26;token=25edc612-c4e6-49e4-9e17-bfeccdb35f98" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://344220114-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MVSV22dcsjKDdOxDA6n%2Fuploads%2FlO77aQNZdo49olObDeJA%2Fimage.png?alt=media&#x26;token=d28bb68b-2943-4f7c-baa8-cefaa6b745fc" alt=""><figcaption></figcaption></figure>
