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.
This commit is contained in:
rbalsleyMSFT
2026-06-25 17:16:08 -07:00
parent b26183f5d1
commit 4b2e645751
+7 -7
View File
@@ -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
}
}