mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-05-01 22:24:43 +02:00
Update clear-recycle-bin.ps1
This commit is contained in:
parent
9a0c57139c
commit
1d228e8fb5
@ -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))"
|
||||||
|
Loading…
Reference in New Issue
Block a user