From 47fefb0898202d9cc56dade97915fdad0856765e Mon Sep 17 00:00:00 2001 From: zoicware <118035521+zoicware@users.noreply.github.com> Date: Sat, 6 Dec 2025 15:46:03 -0500 Subject: [PATCH] ignore when a package path doesnt exist fix #60 #41 --- RemoveWindowsAi.ps1 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/RemoveWindowsAi.ps1 b/RemoveWindowsAi.ps1 index 924caca..4d03126 100644 --- a/RemoveWindowsAi.ps1 +++ b/RemoveWindowsAi.ps1 @@ -1262,12 +1262,12 @@ function Remove-AI-Files { if (!(Test-Path $appsPath6)) { $appsPath6 = "$env:windir\SystemApps\SxS" } - $pathsSystemApps = (Get-ChildItem -Path $appsPath -Directory -Force).FullName - $pathsWindowsApps = (Get-ChildItem -Path $appsPath2 -Directory -Force).FullName - $pathsAppRepo = (Get-ChildItem -Path $appsPath3 -Directory -Force -Recurse).FullName - $pathsServicing = (Get-ChildItem -Path $appsPath4 -Directory -Force -Recurse).FullName - $pathsCatRoot = (Get-ChildItem -Path $appsPath5 -Directory -Force -Recurse).FullName - $pathsSXS = (Get-ChildItem -Path $appsPath6 -Directory -Force).FullName + $pathsSystemApps = (Get-ChildItem -Path $appsPath -Directory -Force -ErrorAction SilentlyContinue).FullName + $pathsWindowsApps = (Get-ChildItem -Path $appsPath2 -Directory -Force -ErrorAction SilentlyContinue).FullName + $pathsAppRepo = (Get-ChildItem -Path $appsPath3 -Directory -Force -Recurse -ErrorAction SilentlyContinue).FullName + $pathsServicing = (Get-ChildItem -Path $appsPath4 -Directory -Force -Recurse -ErrorAction SilentlyContinue).FullName + $pathsCatRoot = (Get-ChildItem -Path $appsPath5 -Directory -Force -Recurse -ErrorAction SilentlyContinue).FullName + $pathsSXS = (Get-ChildItem -Path $appsPath6 -Directory -Force -ErrorAction SilentlyContinue).FullName $packagesPath = @() #get full path