From c1983f75e6d553d3a1873cef56fa3915ed78d875 Mon Sep 17 00:00:00 2001 From: rbalsleyMSFT <53497092+rbalsleyMSFT@users.noreply.github.com> Date: Fri, 8 Aug 2025 19:29:50 -0700 Subject: [PATCH] fix: fixed unattend file copying logic for USB deployment based on architecture --- FFUDevelopment/BuildFFUVM.ps1 | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/FFUDevelopment/BuildFFUVM.ps1 b/FFUDevelopment/BuildFFUVM.ps1 index 6cfc201..f67450b 100644 --- a/FFUDevelopment/BuildFFUVM.ps1 +++ b/FFUDevelopment/BuildFFUVM.ps1 @@ -3388,8 +3388,19 @@ Function New-DeploymentUSB { if ($using:CopyUnattend) { $UnattendPathOnUSB = Join-Path $DeployPartitionDriveLetter "Unattend" - WriteLog "Copying Unattend files to $UnattendPathOnUSB" - robocopy $using:UnattendFolder $UnattendPathOnUSB /E /COPYALL /R:5 /W:5 /J /NFL /NDL /NJH /NJS /nc /ns /np | Out-Null + WriteLog "Copying unattend file to $UnattendPathOnUSB" + New-Item -Path $UnattendPathOnUSB -ItemType Directory -ErrorAction SilentlyContinue | Out-Null + if ($using:WindowsArch -eq 'x64') { + Copy-Item -Path (Join-Path $using:UnattendFolder 'unattend_x64.xml') -Destination (Join-Path $UnattendPathOnUSB 'Unattend.xml') -Force | Out-Null + } + elseif ($using:WindowsArch -eq 'arm64') { + Copy-Item -Path (Join-Path $using:UnattendFolder 'unattend_arm64.xml') -Destination (Join-Path $UnattendPathOnUSB 'Unattend.xml') -Force | Out-Null + } + if (Test-Path (Join-Path $using:UnattendFolder 'prefixes.txt')) { + WriteLog "Copying prefixes.txt file to $UnattendPathOnUSB" + Copy-Item -Path (Join-Path $using:UnattendFolder 'prefixes.txt') -Destination (Join-Path $UnattendPathOnUSB 'prefixes.txt') -Force | Out-Null + } + WriteLog 'Copy completed' } if ($using:CopyAutopilot) {