Update clear-recycle-bin.ps1

This commit is contained in:
Markus Fleschutz 2021-12-13 08:36:10 +01:00
parent 9a0c57139c
commit 1d228e8fb5

View File

@ -1,12 +1,11 @@
<# <#
.SYNOPSIS .SYNOPSIS
Removes the content of the recycle bin folder permanently Clears the recycle bin folder
.DESCRIPTION .DESCRIPTION
This script removes the content of the recycle bin folder permanently. This script removes the content of the recycle bin folder permanently.
NOTE: can not be undo! NOTE: this cannot be undo!
.EXAMPLE .EXAMPLE
PS> ./clear-recycle-bin PS> ./clear-recycle-bin
cleared recycle bin
.NOTES .NOTES
Author: Markus Fleschutz · License: CC0 Author: Markus Fleschutz · License: CC0
.LINK .LINK
@ -17,7 +16,7 @@ try {
Clear-RecycleBin -Confirm:$false Clear-RecycleBin -Confirm:$false
if ($lastExitCode -ne "0") { throw "'Clear-RecycleBin' failed" } if ($lastExitCode -ne "0") { throw "'Clear-RecycleBin' failed" }
"✔️ cleared recycle bin" & "$PSScriptRoot/give-reply.ps1" "It's clean now."
exit 0 # success exit 0 # success
} catch { } catch {
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"