From 4b2e6457515713baded2ca867ef9ab8d3a55ad07 Mon Sep 17 00:00:00 2001 From: rbalsleyMSFT <53497092+rbalsleyMSFT@users.noreply.github.com> Date: Thu, 25 Jun 2026 17:16:08 -0700 Subject: [PATCH] Fix single FFU USB copy logging Use the selected FFU count in New-DeploymentUSB so one-item arrays log as single-file copies while multi-FFU copies keep the existing multiple-file message. --- FFUDevelopment/BuildFFUVM.ps1 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/FFUDevelopment/BuildFFUVM.ps1 b/FFUDevelopment/BuildFFUVM.ps1 index 5704935..3885c79 100644 --- a/FFUDevelopment/BuildFFUVM.ps1 +++ b/FFUDevelopment/BuildFFUVM.ps1 @@ -4789,15 +4789,15 @@ Function New-DeploymentUSB { # Copy other files if ($using:CopyFFU.IsPresent -and $null -ne $using:SelectedFFUFile) { - if ($using:SelectedFFUFile -is [array]) { + $selectedFFUFiles = @($using:SelectedFFUFile) + if ($selectedFFUFiles.Count -gt 1) { WriteLog "Copying multiple FFU files to $DeployPartitionDriveLetter" - foreach ($FFUFile in $using:SelectedFFUFile) { - robocopy (Split-Path $FFUFile -Parent) $DeployPartitionDriveLetter (Split-Path $FFUFile -Leaf) /J /NFL /NDL /NJH /NJS /nc /ns /np | Out-Null - } } - else { - WriteLog "Copying $($using:SelectedFFUFile) to $DeployPartitionDriveLetter" - robocopy (Split-Path $using:SelectedFFUFile -Parent) $DeployPartitionDriveLetter (Split-Path $using:SelectedFFUFile -Leaf) /J /NFL /NDL /NJH /NJS /nc /ns /np | Out-Null + elseif ($selectedFFUFiles.Count -eq 1) { + WriteLog "Copying $(Split-Path $selectedFFUFiles[0] -Leaf) to $DeployPartitionDriveLetter" + } + foreach ($ffuFile in $selectedFFUFiles) { + robocopy (Split-Path $ffuFile -Parent) $DeployPartitionDriveLetter (Split-Path $ffuFile -Leaf) /J /NFL /NDL /NJH /NJS /nc /ns /np | Out-Null } }