From 082b6d284718d2666c8c2cbed976dd1faf180d9e Mon Sep 17 00:00:00 2001 From: Mylloon Date: Mon, 1 Jan 2024 18:08:46 +0100 Subject: [PATCH] minor fixes --- .config/fish/functions/trash.fish | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/fish/functions/trash.fish b/.config/fish/functions/trash.fish index f54d5cd..32a414a 100644 --- a/.config/fish/functions/trash.fish +++ b/.config/fish/functions/trash.fish @@ -12,8 +12,8 @@ function trash --description "Move file or directory to the windows recycle bin. set file "$argv[1]" powershell.exe -Command "& {" \ " Add-Type -AssemblyName 'Microsoft.VisualBasic';" \ - " Get-ChildItem -Path $file | ForEach-Object {" \ - " if (\$_.GetType() -eq [System.IO.DirectoryInfo]) {" \ + " 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')" \