Skip to content

New-OSBuildMultiLang.ps1 - Fix UpdateOS for Win11 #94

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Public/New-OSBuildMultiLang.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ function New-OSBuildMultiLang {
Block-StandardUser
#=================================================
}

Process {
Write-Host '========================================================================================' -ForegroundColor DarkGray
Write-Host -ForegroundColor Green "$($MyInvocation.MyCommand.Name) PROCESS"
Write-Warning "OSBuild MultiLang will take an OSBuild with Language Packs"
Write-Warning "and create a new OSBuild with multiple Indexes"
Write-Warning "Each Index will have a Language set as the System UI"
Write-Warning "This process will take some time as the LCU will be reapplied"

#=================================================
# Get OSBuilds with Multi Lang
#=================================================
Expand Down Expand Up @@ -98,7 +98,7 @@ function New-OSBuildMultiLang {
$OSBuild = $($LangMultiWindowsImage.Build)
$OSInstallationType = $($LangMultiWindowsImage.InstallationType)
$OSMajorVersion = $($LangMultiWindowsImage.MajorVersion)
$WindowsImageMediaName = $($LangMultiWindowsImage.MediaName)
$WindowsImageName = $($LangMultiWindowsImage.ImageName)
$OSVersion = $($LangMultiWindowsImage.Version)

if ($OSArchitecture -eq '0') {$OSArchitecture = 'x86'}
Expand All @@ -114,7 +114,7 @@ function New-OSBuildMultiLang {
$UpdateOS = 'Windows Server'
}
else {
if ($WindowsImageMediaName -match ' 11 ') {
if ($WindowsImageName -match ' 11 ') {
$UpdateOS = 'Windows 11'
}
else {
Expand All @@ -138,10 +138,10 @@ function New-OSBuildMultiLang {

Write-Host "Exporting install.wim to $DestinationFullName\OS\Sources\install.wim" -ForegroundColor Cyan
Export-WindowsImage -SourceImagePath "$SourceFullName\OS\Sources\install.wim" -SourceIndex 1 -DestinationImagePath "$DestinationFullName\OS\Sources\install.wim" -DestinationName "$($Media.ImageName) $LangMultiDefaultName" | Out-Null

Write-Host "Exporting temporary install.wim to $TempInstallWim" -ForegroundColor Cyan
Export-WindowsImage -SourceImagePath "$SourceFullName\OS\Sources\Install.wim" -SourceIndex 1 -DestinationImagePath "$TempInstallWim" -DestinationName "$($Media.ImageName)" | Out-Null

$MountDirectory = Join-Path "$env:Temp" "mount$((Get-Date).ToString('mmss'))"
New-Item "$MountDirectory" -ItemType Directory | Out-Null
Mount-WindowsImage -Path "$MountDirectory" -ImagePath "$TempInstallWim" -Index 1 | Out-Null
Expand All @@ -164,7 +164,7 @@ function New-OSBuildMultiLang {

Write-Host "Dism /Image:"$MountDirectory" /Get-Intl" -ForegroundColor Cyan
Dism /Image:"$MountDirectory" /Get-Intl

Write-Warning "Waiting 10 seconds for processes to complete before applying LCU ..."
Start-Sleep -Seconds 10
Update-CumulativeOS -Force
Expand Down