minor fixes

This commit is contained in:
Mylloon 2024-01-01 18:08:46 +01:00
parent 8898a93879
commit 082b6d2847
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -12,8 +12,8 @@ function trash --description "Move file or directory to the windows recycle bin.
set file "$argv[1]" set file "$argv[1]"
powershell.exe -Command "& {" \ powershell.exe -Command "& {" \
" Add-Type -AssemblyName 'Microsoft.VisualBasic';" \ " Add-Type -AssemblyName 'Microsoft.VisualBasic';" \
" Get-ChildItem -Path $file | ForEach-Object {" \ " Get-ChildItem -Path '$file' | ForEach-Object {" \
" if (\$_.GetType() -eq [System.IO.DirectoryInfo]) {" \ " if (\$_ -is [System.IO.DirectoryInfo]) {" \
" [Microsoft.VisualBasic.FileIO.FileSystem]::DeleteDirectory(\$_.FullName, 'OnlyErrorDialogs', 'SendToRecycleBin')" \ " [Microsoft.VisualBasic.FileIO.FileSystem]::DeleteDirectory(\$_.FullName, 'OnlyErrorDialogs', 'SendToRecycleBin')" \
" } else {" \ " } else {" \
" [Microsoft.VisualBasic.FileIO.FileSystem]::DeleteFile(\$_.FullName, 'OnlyErrorDialogs', 'SendToRecycleBin')" \ " [Microsoft.VisualBasic.FileIO.FileSystem]::DeleteFile(\$_.FullName, 'OnlyErrorDialogs', 'SendToRecycleBin')" \