Tip: You can empty the recycle bin:
1 2 3 4 5 6 7 8 9 |
# 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 |