mirror of
https://github.com/rbalsleyMSFT/FFU.git
synced 2026-06-14 02:09:35 -06:00
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.
This commit is contained in:
@@ -337,8 +337,8 @@ If (Test-Path -Path $UnattendComputerNamePath) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#Ask for device name if unattend exists
|
#Ask for device name if unattend exists
|
||||||
if ($Unattend -and $UnattendPrefix) {
|
|
||||||
Write-SectionHeader 'Device Name Selection'
|
Write-SectionHeader 'Device Name Selection'
|
||||||
|
if ($Unattend -and $UnattendPrefix) {
|
||||||
Writelog 'Unattend file found with prefixes.txt. Getting prefixes.'
|
Writelog 'Unattend file found with prefixes.txt. Getting prefixes.'
|
||||||
$UnattendPrefixes = @(Get-content $UnattendPrefixFile)
|
$UnattendPrefixes = @(Get-content $UnattendPrefixFile)
|
||||||
$UnattendPrefixCount = $UnattendPrefixes.Count
|
$UnattendPrefixCount = $UnattendPrefixes.Count
|
||||||
@@ -385,7 +385,6 @@ if ($Unattend -and $UnattendPrefix) {
|
|||||||
Write-Host "Computer name set to $computername"
|
Write-Host "Computer name set to $computername"
|
||||||
}
|
}
|
||||||
elseif ($Unattend -and $UnattendComputerName) {
|
elseif ($Unattend -and $UnattendComputerName) {
|
||||||
Write-SectionHeader 'Device Name Selection'
|
|
||||||
Writelog 'Unattend file found with SerialComputerNames.csv. Getting name for current computer.'
|
Writelog 'Unattend file found with SerialComputerNames.csv. Getting name for current computer.'
|
||||||
$SerialComputerNames = Import-Csv -Path $UnattendComputerNameFile.FullName -Delimiter ","
|
$SerialComputerNames = Import-Csv -Path $UnattendComputerNameFile.FullName -Delimiter ","
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user