cleanup recycle bin cleaner

This commit is contained in:
2025-08-15 16:00:11 -04:00
parent 3f89290295
commit 821505014d
+1 -5
View File
@@ -68,11 +68,7 @@ If ( ($UserRecycleBins | Measure-Object).Count -gt 0 ) {
$items = Get-ChildItem -Path $userRecycleBin.FullName -Recurse -ErrorAction SilentlyContinue
ForEach ( $item in $items ) {
If ( $item.LastWriteTime -lt $TimeDelta ) {
Try {
Remove-Item -Path $item.FullName -Force -ErrorAction Continue
$itemFullName = $item.FullName
Write-Output "DELETING: ${itemFullName}"
}
Try { Remove-Item -Path $item.FullName -Force -ErrorAction Continue }
Catch { Write-Error $_.Exception.Message }
}
}