Created
November 5, 2015 12:13
-
-
Save ooltcloud/bcd341a0163b9aeb84a2 to your computer and use it in GitHub Desktop.
指定したファイルをゴミ箱に捨てる
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add-Type -a Microsoft.VisualBasic | |
Function Send-RecycleBin($filename) { | |
(gci $filename) | | |
% { | |
Write-Host $_.FullName; | |
[Microsoft.VisualBasic.FileIO.FileSystem]::DeleteFile( | |
$_, | |
[Microsoft.VisualBasic.FileIO.UIOption]::OnlyErrorDialogs, | |
[Microsoft.VisualBasic.FileIO.RecycleOption]::SendToRecycleBin | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment