Recycle Bin
Aus Wiki-WebPerfect
Version vom 25. Mai 2020, 07:28 Uhr von Admin (Diskussion | Beiträge)
Empty the recycle bin
# Solution 1 Get-ChildItem -Path 'C:\$Recycle.Bin' -Force | Remove-Item -Recurse -ErrorAction SilentlyContinue # Solution 2 $recycleBin = (New-Object -ComObject Shell.Application).NameSpace(0xa) $recycleBin.Items() | ForEach-Object -Process { Remove-Item -Path $_.Path -Force -Recurse } # Solution 3 (PowerShell v5) Clear-RecycleBin -Force
Source: http://powershell-guru.com/powershell-tip-74-empty-the-recycle-bin/