From 5bef901295572a9cd04b2d3c450408795a78fcb5 Mon Sep 17 00:00:00 2001 From: rbalsleyMSFT <53497092+rbalsleyMSFT@users.noreply.github.com> Date: Wed, 6 Aug 2025 16:42:54 -0700 Subject: [PATCH] Deduplicate device name section header output Moves the 'Device Name Selection' section header out of the conditional blocks to a common location. This refactoring avoids code repetition and improves maintainability. --- FFUDevelopment/WinPEDeployFFUFiles/ApplyFFU.ps1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/FFUDevelopment/WinPEDeployFFUFiles/ApplyFFU.ps1 b/FFUDevelopment/WinPEDeployFFUFiles/ApplyFFU.ps1 index 701f1f7..f32283b 100644 --- a/FFUDevelopment/WinPEDeployFFUFiles/ApplyFFU.ps1 +++ b/FFUDevelopment/WinPEDeployFFUFiles/ApplyFFU.ps1 @@ -337,8 +337,8 @@ If (Test-Path -Path $UnattendComputerNamePath) { } #Ask for device name if unattend exists +Write-SectionHeader 'Device Name Selection' if ($Unattend -and $UnattendPrefix) { - Write-SectionHeader 'Device Name Selection' Writelog 'Unattend file found with prefixes.txt. Getting prefixes.' $UnattendPrefixes = @(Get-content $UnattendPrefixFile) $UnattendPrefixCount = $UnattendPrefixes.Count @@ -385,7 +385,6 @@ if ($Unattend -and $UnattendPrefix) { Write-Host "Computer name set to $computername" } elseif ($Unattend -and $UnattendComputerName) { - Write-SectionHeader 'Device Name Selection' Writelog 'Unattend file found with SerialComputerNames.csv. Getting name for current computer.' $SerialComputerNames = Import-Csv -Path $UnattendComputerNameFile.FullName -Delimiter ","