ignore when a package path doesnt exist fix #60 #41

This commit is contained in:
zoicware
2025-12-06 15:46:03 -05:00
committed by GitHub
parent d5f8858a14
commit 47fefb0898

View File

@@ -1262,12 +1262,12 @@ function Remove-AI-Files {
if (!(Test-Path $appsPath6)) { if (!(Test-Path $appsPath6)) {
$appsPath6 = "$env:windir\SystemApps\SxS" $appsPath6 = "$env:windir\SystemApps\SxS"
} }
$pathsSystemApps = (Get-ChildItem -Path $appsPath -Directory -Force).FullName $pathsSystemApps = (Get-ChildItem -Path $appsPath -Directory -Force -ErrorAction SilentlyContinue).FullName
$pathsWindowsApps = (Get-ChildItem -Path $appsPath2 -Directory -Force).FullName $pathsWindowsApps = (Get-ChildItem -Path $appsPath2 -Directory -Force -ErrorAction SilentlyContinue).FullName
$pathsAppRepo = (Get-ChildItem -Path $appsPath3 -Directory -Force -Recurse).FullName $pathsAppRepo = (Get-ChildItem -Path $appsPath3 -Directory -Force -Recurse -ErrorAction SilentlyContinue).FullName
$pathsServicing = (Get-ChildItem -Path $appsPath4 -Directory -Force -Recurse).FullName $pathsServicing = (Get-ChildItem -Path $appsPath4 -Directory -Force -Recurse -ErrorAction SilentlyContinue).FullName
$pathsCatRoot = (Get-ChildItem -Path $appsPath5 -Directory -Force -Recurse).FullName $pathsCatRoot = (Get-ChildItem -Path $appsPath5 -Directory -Force -Recurse -ErrorAction SilentlyContinue).FullName
$pathsSXS = (Get-ChildItem -Path $appsPath6 -Directory -Force).FullName $pathsSXS = (Get-ChildItem -Path $appsPath6 -Directory -Force -ErrorAction SilentlyContinue).FullName
$packagesPath = @() $packagesPath = @()
#get full path #get full path