change .name to .pspath

This commit is contained in:
zoicware
2025-11-05 15:39:53 -05:00
committed by GitHub
parent ec4db51a4e
commit dd2e3e4eee

View File

@@ -1406,7 +1406,7 @@ 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 "registry::$($_.Name)" -Recurse -Force -ErrorAction SilentlyContinue Remove-Item $_.PSPath -Recurse -Force -ErrorAction SilentlyContinue
} }
} }