from privacy.sexy #59

Closed
opened 2024-11-04 15:35:56 +01:00 by Anri · 0 comments
Owner

powershell.exe -Command "& {" \
" Add-Type -AssemblyName 'Microsoft.VisualBasic';" \
" Get-ChildItem -Path '$file' | ForEach-Object {" \
" if (\$_ -is [System.IO.DirectoryInfo]) {" \
" [Microsoft.VisualBasic.FileIO.FileSystem]::DeleteDirectory(\$_.FullName, 'OnlyErrorDialogs', 'SendToRecycleBin')" \
" } else {" \
" [Microsoft.VisualBasic.FileIO.FileSystem]::DeleteFile(\$_.FullName, 'OnlyErrorDialogs', 'SendToRecycleBin')" \
" }" \
" }" \
"}"

:: ----------------------------------------------------------
:: ----------------Empty trash (Recycle Bin)-----------------
:: ----------------------------------------------------------
echo --- Empty trash (Recycle Bin)
PowerShell -ExecutionPolicy Unrestricted -Command "$bin = (New-Object -ComObject Shell.Application).NameSpace(10); $bin.items() | ForEach { Write-Host "^""Deleting $($_.Name) from Recycle Bin"^""; Remove-Item $_.Path -Recurse -Force; }"
:: ----------------------------------------------------------
https://git.mylloon.fr/Anri/confOS/src/commit/2e78c2dabff84afc6c4b9e65b11e4cf29d2d48e1/.config/fish/functions/trash.fish#L16-L25 ```batch :: ---------------------------------------------------------- :: ----------------Empty trash (Recycle Bin)----------------- :: ---------------------------------------------------------- echo --- Empty trash (Recycle Bin) PowerShell -ExecutionPolicy Unrestricted -Command "$bin = (New-Object -ComObject Shell.Application).NameSpace(10); $bin.items() | ForEach { Write-Host "^""Deleting $($_.Name) from Recycle Bin"^""; Remove-Item $_.Path -Recurse -Force; }" :: ---------------------------------------------------------- ```
Anri closed this issue 2024-11-05 12:17:38 +01:00
Sign in to join this conversation.
No labels
arch
windows
wsl
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Anri/confOS#59
No description provided.