mirror of
https://github.com/zoicware/RemoveWindowsAI.git
synced 2025-12-17 15:16:27 +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 ($keyword in $aiKeyWords) {
|
||||||
foreach ($location in $regLocations) {
|
foreach ($location in $regLocations) {
|
||||||
Get-ChildItem $location -Recurse -ErrorAction SilentlyContinue | Where-Object { $_.PSChildName -like "*$keyword*" } | ForEach-Object {
|
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