Added cleanup of Win32 and MSStore folders

This commit is contained in:
Zehadi Alam
2024-06-30 19:45:43 -04:00
parent 1729eaddd6
commit 205b58aaa7
+23 -1
View File
@@ -3038,7 +3038,15 @@ function Get-FFUEnvironment {
Remove-Item -Path $EdgePath -Recurse -Force Remove-Item -Path $EdgePath -Recurse -Force
WriteLog 'Removal complete' WriteLog 'Removal complete'
} }
if (Test-Path -Path "$AppsPath\Win32" -PathType Container) {
WriteLog "Cleaning up Win32 folder"
Remove-Item -Path "$AppsPath\Win32" -Recurse -Force
}
if (Test-Path -Path "$AppsPath\MSStore" -PathType Container) {
WriteLog "Cleaning up MSStore folder"
Remove-Item -Path "$AppsPath\MSStore" -Recurse -Force
}
Clear-InstallAppsandSysprep
Writelog 'Removing dirty.txt file' Writelog 'Removing dirty.txt file'
Remove-Item -Path "$FFUDevelopmentPath\dirty.txt" -Force Remove-Item -Path "$FFUDevelopmentPath\dirty.txt" -Force
WriteLog "Cleanup complete" WriteLog "Cleanup complete"
@@ -3600,6 +3608,20 @@ catch {
Writelog "Cleaning up InstallAppsandSysprep.cmd failed with error $_" Writelog "Cleaning up InstallAppsandSysprep.cmd failed with error $_"
throw $_ throw $_
} }
try {
if (Test-Path -Path "$AppsPath\Win32" -PathType Container) {
WriteLog "Cleaning up Win32 folder"
Remove-Item -Path "$AppsPath\Win32" -Recurse -Force
}
if (Test-Path -Path "$AppsPath\MSStore" -PathType Container) {
WriteLog "Cleaning up MSStore folder"
Remove-Item -Path "$AppsPath\MSStore" -Recurse -Force
}
}
catch {
WriteLog "$_"
throw $_
}
#Create Deployment Media #Create Deployment Media
If ($CreateDeploymentMedia) { If ($CreateDeploymentMedia) {
try { try {