From 3f0377fbf99481af440a16c49c75f5f9a31ff826 Mon Sep 17 00:00:00 2001 From: Matthew Haley <30245+mhaley@users.noreply.github.com> Date: Mon, 8 Jul 2024 13:45:44 -0700 Subject: [PATCH] Assign drive letter to recovery partition before modification Assign drive letter so copy succeeds, remove when finished. --- FFUDevelopment/WinPEDeployFFUFiles/ApplyFFU.ps1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/FFUDevelopment/WinPEDeployFFUFiles/ApplyFFU.ps1 b/FFUDevelopment/WinPEDeployFFUFiles/ApplyFFU.ps1 index c6b9491..4c9c69d 100644 --- a/FFUDevelopment/WinPEDeployFFUFiles/ApplyFFU.ps1 +++ b/FFUDevelopment/WinPEDeployFFUFiles/ApplyFFU.ps1 @@ -495,10 +495,12 @@ $WinRE = $USBDrive + "WinRE\winre.wim" If (Test-Path -Path $WinRE) { WriteLog 'Copying modified WinRE to Recovery directory' + Get-Disk | Where-Object Number -eq $DiskID | Get-Partition | Where-Object Type -eq Recovery | Set-Partition -NewDriveLetter R Invoke-Process xcopy.exe "/h $WinRE R:\Recovery\WindowsRE\ /Y" WriteLog 'Copying WinRE to Recovery directory succeeded' WriteLog 'Registering location of recovery tools' Invoke-Process W:\Windows\System32\Reagentc.exe "/Setreimage /Path R:\Recovery\WindowsRE /Target W:\Windows" + Get-Disk | Where-Object Number -eq $DiskID | Get-Partition | Where-Object Type -eq Recovery | Remove-PartitionAccessPath -AccessPath R: WriteLog 'Registering location of recovery tools succeeded' } # else