Skip to content

Instantly share code, notes, and snippets.

@techdecline
Created July 21, 2020 06:54
Show Gist options
  • Select an option

  • Save techdecline/c3388738e110bb69a341c020b3483181 to your computer and use it in GitHub Desktop.

Select an option

Save techdecline/c3388738e110bb69a341c020b3483181 to your computer and use it in GitHub Desktop.
#Requires -RunAsAdministrator
param (
# ISO Path
[Parameter(Mandatory)]
[ValidateScript({Test-Path $_})]
[String]
$IsoPath,
# Language Pack ISO
[Parameter(Mandatory=$false)]
[ValidateScript({Test-Path $_})]
[string]
$LPIsoPath,
# Language Pack Arr
[Parameter(Mandatory=$false)]
[string[]]
$LanguageList,
# OS Version
[Parameter(Mandatory)]
[ValidateSet(1903,1909,2004)]
[int]
$OSVersion
)
Import-Module OSDBuilder
Mount-DiskImage -ImagePath $IsoPath
Import-OSMedia
if ($LPIsoPath) {
$driveLetter = (Mount-DiskImage $LPIsoPath | Get-Volume).DriveLetter
foreach ($language in $LanguageList) {
New-OSDBuilderContentPack -Name "MultiLang $language" -ContentType MultiLang
# Copy Language Pack
New-Item "c:\OSDBuilder\ContentPacks\MultiLang $language\OSLanguagePacks\$OSVersion x64" -ItemType Directory
Get-ChildItem "$($driveLetter):\x64" -Recurse -Filter "*$language.cab" | ForEach-Object { Copy-Item -Path $_.FullName -Destination "c:\OSDBuilder\ContentPacks\MultiLang $language\OSLanguagePacks\$OSVersion x64" }
# Copy Language Experience Pack with License XML
New-Item "c:\OSDBuilder\ContentPacks\MultiLang $language\OSLocalExperiencePacks\$OSVersion x64" -ItemType Directory
Get-ChildItem "$($driveLetter):\LocalExperiencePack" -Recurse -Filter "*$language*.appx" | ForEach-Object { Get-ChildItem (Split-Path $_.FullName) | Copy-Item -Destination "c:\OSDBuilder\ContentPacks\MultiLang $language\OSLocalExperiencePacks\$OSVersion x64"}
}
Dismount-DiskImage -ImagePath $LPIsoPath
}
Get-DownOSDBuilder -ContentDownload "OneDriveSetup Production"
New-OSBuildTask -TaskName "Windows 10 $OSVersion with MUI" -AddContentPacks
Get-OSMedia | Where-Object Name -like "Windows 10 Enterprise x64 $OSVersion*" | Where-Object Revision -eq 'OK' | Where-Object Updates -eq 'Update' | ForEach-Object {Update-OSMedia -Download -Execute -Name $_.Name}
New-OSBuild -Download -Execute -ByTaskName "Windows 10 $OSVersion with MUI" -CreateISO
Dismount-DiskImage -ImagePath $IsoPath
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment