From 7c9f24f6958d4f149be646cd60704af1ca52147b Mon Sep 17 00:00:00 2001 From: rbalsleyMSFT <53497092+rbalsleyMSFT@users.noreply.github.com> Date: Thu, 16 Jan 2025 18:00:08 -0800 Subject: [PATCH] Fixed issues - Fixed an issue where if AppsScriptVariables was configured in a config file, the hashtable wasn't being created by the script when setting the variable. - Fixed a crash where shortening the Windows SKU was creating duplicate shortened names for certain SKUs. --- FFUDevelopment/BuildFFUVM.ps1 | 36 +++++++++---------- .../WinPEDeployFFUFiles/ApplyFFU.ps1 | 2 +- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/FFUDevelopment/BuildFFUVM.ps1 b/FFUDevelopment/BuildFFUVM.ps1 index 352d315..fe2107c 100644 --- a/FFUDevelopment/BuildFFUVM.ps1 +++ b/FFUDevelopment/BuildFFUVM.ps1 @@ -384,12 +384,12 @@ if ($ConfigFile -and (Test-Path -Path $ConfigFile)) { } # If this is the Headers parameter, convert PSCustomObject to hashtable - if ($key -eq 'Headers' -and $value -is [System.Management.Automation.PSCustomObject]) { - $headers = [hashtable]::new() + if ((($key -eq 'Headers') -or ($key -eq 'AppsScriptVariables')) -and ($value -is [System.Management.Automation.PSCustomObject])) { + $hashtableValue = [hashtable]::new() foreach ($prop in $value.psobject.Properties) { - $headers[$prop.Name] = $prop.Value + $hashtableValue[$prop.Name] = $prop.Value } - $value = $headers + $value = $hashtableValue } # Check if this key matches a parameter in the script @@ -3135,36 +3135,34 @@ function Get-ShortenedWindowsSKU { ) $shortenedWindowsSKU = switch ($WindowsSKU) { 'Core' { 'Home' } - 'CoreN' { 'Home_N' } - 'CoreSingleLanguage' { 'Home_SL' } - 'Education' { 'Edu' } - 'EducationN' { 'Edu_N' } - 'Professional' { 'Pro' } - 'ProfessionalN' { 'Pro_N' } - 'ProfessionalEducation' { 'Pro_Edu' } - 'ProfessionalEducationN' { 'Pro_Edu_N' } - 'ProfessionalWorkstation' { 'Pro_WKS' } - 'ProfessionalWorkstationN' { 'Pro_WKS_N' } - 'Enterprise' { 'Ent' } - 'EnterpriseN' { 'Ent_N' } - 'ServerStandard' { 'Srv_Std' } - 'ServerDatacenter' { 'Srv_Dtc' } 'Home' { 'Home' } + 'CoreN' { 'Home_N' } 'Home N' { 'Home_N' } + 'CoreSingleLanguage' { 'Home_SL' } 'Home Single Language' { 'Home_SL' } 'Education' { 'Edu' } + 'EducationN' { 'Edu_N' } 'Education N' { 'Edu_N' } 'Professional' { 'Pro' } + 'Pro' { 'Pro' } + 'ProfessionalN' { 'Pro_N' } 'Pro N' { 'Pro_N' } + 'ProfessionalEducation' { 'Pro_Edu' } 'Pro Education' { 'Pro_Edu' } + 'ProfessionalEducationN' { 'Pro_Edu_N' } 'Pro Education N' { 'Pro_Edu_N' } + 'ProfessionalWorkstation' { 'Pro_WKS' } 'Pro for Workstations' { 'Pro_WKS' } + 'ProfessionalWorkstationN' { 'Pro_WKS_N' } 'Pro N for Workstations' { 'Pro_WKS_N' } 'Enterprise' { 'Ent' } + 'EnterpriseN' { 'Ent_N' } 'Enterprise N' { 'Ent_N' } + 'ServerStandard' { 'Srv_Std' } 'Standard' { 'Srv_Std' } - 'Standard (Desktop Experience)' { 'Srv_Std_DE' } + 'ServerDatacenter' { 'Srv_Dtc' } 'Datacenter' { 'Srv_Dtc' } + 'Standard (Desktop Experience)' { 'Srv_Std_DE' } 'Datacenter (Desktop Experience)' { 'Srv_Dtc_DE' } } return $shortenedWindowsSKU diff --git a/FFUDevelopment/WinPEDeployFFUFiles/ApplyFFU.ps1 b/FFUDevelopment/WinPEDeployFFUFiles/ApplyFFU.ps1 index 74746a7..99b701a 100644 --- a/FFUDevelopment/WinPEDeployFFUFiles/ApplyFFU.ps1 +++ b/FFUDevelopment/WinPEDeployFFUFiles/ApplyFFU.ps1 @@ -135,7 +135,7 @@ $LogFileName = 'ScriptLog.txt' $USBDrive = Get-USBDrive New-item -Path $USBDrive -Name $LogFileName -ItemType "file" -Force | Out-Null $LogFile = $USBDrive + $LogFilename -$version = '2412.3' +$version = '2412.4' WriteLog 'Begin Logging' WriteLog "Script version: $version"