diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4cc57e1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +PSGetModuleInfo.xml +README.md +README.md diff --git a/Public/New-OSBuildMultiLang.ps1 b/Public/New-OSBuildMultiLang.ps1 index 72ae85b..4ddb9d6 100644 --- a/Public/New-OSBuildMultiLang.ps1 +++ b/Public/New-OSBuildMultiLang.ps1 @@ -45,7 +45,7 @@ function New-OSBuildMultiLang { 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" + # Write-Warning "This process will take some time as the DotNet & LCU will be reapplied" #================================================= # Get OSBuilds with Multi Lang @@ -98,7 +98,7 @@ function New-OSBuildMultiLang { $OSBuild = $($LangMultiWindowsImage.Build) $OSInstallationType = $($LangMultiWindowsImage.InstallationType) $OSMajorVersion = $($LangMultiWindowsImage.MajorVersion) - $WindowsImageMediaName = $($LangMultiWindowsImage.MediaName) + $WindowsImageMediaName = $($LangMultiWindowsImage.ImageName) $OSVersion = $($LangMultiWindowsImage.Version) if ($OSArchitecture -eq '0') {$OSArchitecture = 'x86'} @@ -123,6 +123,14 @@ function New-OSBuildMultiLang { } } #================================================= + # OSDUpdateDotNet + #================================================= + $OSDUpdateDotNet = $AllOSDUpdates + $OSDUpdateDotNet = $OSDUpdateDotNet | Where-Object {$_.UpdateArch -eq $OSArchitecture} + $OSDUpdateDotNet = $OSDUpdateDotNet | Where-Object {$_.UpdateOS -eq $UpdateOS} + $OSDUpdateDotNet = $OSDUpdateDotNet | Where-Object {($_.UpdateBuild -eq $ReleaseId) -or ($_.UpdateBuild -eq '')} + $OSDUpdateDotNet = $OSDUpdateDotNet | Where-Object {$_.UpdateGroup -like 'DotNet*'} + #================================================= # OSDUpdateLCU #================================================= $OSDUpdateLCU = $AllOSDUpdates @@ -149,7 +157,7 @@ function New-OSBuildMultiLang { # Process Indexes #================================================= foreach ($LangMultiLanguage in $LangMultiLanguages) { - if ($LangMultiLanguage -eq $LangMultiDefaultName) { + if ($LangMultiLanguage -eq $LangMultiDefaultName) { #================================================= # Header #================================================= @@ -157,17 +165,21 @@ function New-OSBuildMultiLang { Write-Host -ForegroundColor Green "$($Media.ImageName) $LangMultiDefaultName is already processed as Index 1" } else { Show-ActionTime - Write-Host -ForegroundColor Green "Processing $($Media.ImageName) $LangMultiLanguage" + Write-Host -ForegroundColor Green "Processing $($Media.ImageName) $LangMultiLanguage" Write-Host "Dism /Image:"$MountDirectory" /Set-AllIntl:$LangMultiLanguage" -ForegroundColor Cyan Dism /Image:"$MountDirectory" /Set-AllIntl:$LangMultiLanguage 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 DotNet ..." + # Start-Sleep -Seconds 10 + # Update-DotNetOS -Force - Write-Warning "Waiting 10 seconds for processes to complete before applying LCU ..." - Start-Sleep -Seconds 10 - Update-CumulativeOS -Force + # Write-Warning "Waiting 10 seconds for processes to complete before applying LCU ..." + # Start-Sleep -Seconds 10 + # Update-CumulativeOS -Force Write-Warning "Waiting 10 seconds for processes to complete before Save-WindowsImage ..." Start-Sleep -Seconds 10 @@ -179,6 +191,35 @@ function New-OSBuildMultiLang { } } #================================================= + # Index Rename + #================================================= + # Retrieve index numbers + $ImageCount = (wimlib-imagex info "$DestinationFullName\OS\Sources\install.wim" | Select-String "Image Count:" | ForEach-Object { $_ -replace "Image Count:\s+", "" }).Trim() + + for ($Index = 1; $Index -le [int]$ImageCount; $Index++) { + # retrieve wiminfo + $WimInfo = wimlib-imagex info "$DestinationFullName\OS\Sources\install.wim" $Index + + # Extract "Default Language" + $DefaultLang = ($WimInfo | Select-String "Default Language:" | ForEach-Object { $_ -replace "Default Language:\s+", "" }).Trim() + + # Extact "Display Name" + $DisplayName = ($WimInfo | Select-String "Display Name:" | ForEach-Object { $_ -replace "Display Name:\s+", "" }).Trim() + + # Extract "Display Description" + $DisplayDescription = ($WimInfo | Select-String "Display Description:" | ForEach-Object { $_ -replace "Display Description:\s+", "" }).Trim() + + # Extract "Description" + $Description = ($WimInfo | Select-String "^\s*Description:" | ForEach-Object { $_ -replace ".*Description:\s+", "" }).Trim() + + $DisplayName = "$DisplayName $DefaultLang" + $DisplayDescription = "$DisplayDescription $DefaultLang" + $Description = "$Description $DefaultLang" + + # Set new Display Name and Display Description + wimlib-imagex info "$DestinationFullName\OS\Sources\install.wim" $Index --image-property DISPLAYNAME="$DisplayName" --image-property DISPLAYDESCRIPTION="$DisplayDescription" --image-property DESCRIPTION="$Description" + } + #================================================= # Cleanup #================================================= try { diff --git a/Public/New-OSDBuilderISO.ps1 b/Public/New-OSDBuilderISO.ps1 index 16a908b..837ff7a 100644 --- a/Public/New-OSDBuilderISO.ps1 +++ b/Public/New-OSDBuilderISO.ps1 @@ -139,7 +139,10 @@ function New-OSDBuilderISO { $OSImageName = "Server $($Media.Version)" $ISOFile = "$ISODestinationFolder\Server $($Media.Version).iso" } else { - if ($Media.MajorVersion -eq 10) { + if ($Media.Build.SubString(0,1) -eq 2) { + $OSImageName = "Win11 $($Media.Arch) $($Media.ReleaseId) $($Media.UBR)" + $ISOFile = "$ISODestinationFolder\Win11 $($Media.Arch) $($Media.ReleaseId) $($Media.UBR).iso" + } elseif ($Media.Build.SubString(0,1) -eq 1) { $OSImageName = "Win10 $($Media.Arch) $($Media.ReleaseId) $($Media.UBR)" $ISOFile = "$ISODestinationFolder\Win10 $($Media.Arch) $($Media.ReleaseId) $($Media.UBR).iso" } elseif ($Media.Version -like "6.3.*") { diff --git a/README.md b/README.md index 633ce31..9ceb6b7 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,3 @@ # OSDBuilder - -January 21, 2025 -OSDBuilder is not working due to updates not being downloaded or installed. Unfortunately, I'm unable to resolve this and do not have an ETA. - -Feel free to post an Issue -https://github.com/OSDeploy/OSDBuilder/issues - -David Segura +PowerShell Module +https://osdbuilder.osdeploy.com \ No newline at end of file