confOS/.config/fish/functions/trash-empty.fish

13 lines
424 B
Fish
Raw Permalink Normal View History

2024-11-04 17:23:50 +01:00
function trash-empty --description "Empty the windows recycle bin."
2024-11-04 17:22:51 +01:00
# Get function name
set current_name $(status current-function)
# Empty trash
powershell.exe -Command "" \
"\$bin = (New-Object -ComObject Shell.Application).NameSpace(10);" \
"\$bin.items() | ForEach {" \
" Write-Host 'Deleting:' \$_.Name;" \
" Remove-Item \$_.Path -Recurse -Force;" \
"}"
end