mirror of
https://github.com/zoicware/RemoveWindowsAI.git
synced 2025-12-17 07:06:29 +01:00
skip empty paths fix #65
This commit is contained in:
@@ -1529,7 +1529,13 @@ function Remove-AI-Files {
|
||||
foreach ($keyword in $aiKeyWords) {
|
||||
foreach ($location in $regLocations) {
|
||||
Get-ChildItem $location -Recurse -ErrorAction SilentlyContinue | Where-Object { $_.PSChildName -like "*$keyword*" } | ForEach-Object {
|
||||
Remove-Item $_.PSPath -Recurse -Force -ErrorAction SilentlyContinue
|
||||
try {
|
||||
Remove-Item $_.PSPath -Recurse -Force -ErrorAction Stop
|
||||
}
|
||||
catch {
|
||||
#ignore when path is null
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user