# Media Cleanup

The default **OSDCloud Template** Media directory contains quite a bit of language resources

![](https://344220114-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MVSV22dcsjKDdOxDA6n%2Fuploads%2FQP4qNBAGIfHkI33xSPAR%2Fimage.png?alt=media\&token=2aebebde-53c3-414b-af41-a4db8baf5a10)

These don't really do much for me as the only language in my WinPE is **en-us**.  This can be cleaned up a bit in PowerShell with these commands

```powershell
$KeepTheseDirs = @('boot','efi','en-us','sources','fonts','resources')
Get-ChildItem $env:ProgramData\OSDCloud\Media | Where {$_.PSIsContainer} | Where {$_.Name -notin $KeepTheseDirs} | Remove-Item -Recurse -Force
Get-ChildItem $env:ProgramData\OSDCloud\Media\Boot | Where {$_.PSIsContainer} | Where {$_.Name -notin $KeepTheseDirs} | Remove-Item -Recurse -Force
Get-ChildItem $env:ProgramData\OSDCloud\Media\EFI\Microsoft\Boot | Where {$_.PSIsContainer} | Where {$_.Name -notin $KeepTheseDirs} | Remove-Item -Recurse -Force
```

![](https://344220114-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MVSV22dcsjKDdOxDA6n%2Fuploads%2Fp9yqju6efAy4rEDkZTOf%2Fimage.png?alt=media\&token=138f56f6-3494-4f27-b5d5-de7f430c3049)

## Sponsor

{% embed url="<https://www.recastsoftware.com/?utm_source=osdeploy&utm_medium=ad&utm_campaign=web>" %}
OSDeploy is sponsored by Recast Software
{% endembed %}
