From bc7ed352fa17304cb0b9c270a84f275224567de8 Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Sun, 2 May 2021 11:14:48 +0200 Subject: [PATCH] Add list-recycle-bin.ps1 --- Data/scripts.csv | 1 + README.md | 1 + Scripts/list-recycle-bin.ps1 | 14 ++++++++++++++ 3 files changed, 16 insertions(+) create mode 100755 Scripts/list-recycle-bin.ps1 diff --git a/Data/scripts.csv b/Data/scripts.csv index 27cc288a..f319669e 100644 --- a/Data/scripts.csv +++ b/Data/scripts.csv @@ -110,6 +110,7 @@ list-processes.ps1, lists the local computer processes list-profiles.ps1, lists your PowerShell profiles list-random-passwords.ps1, prints a list of random passwords list-random-pins.ps1, prints a list of random PIN's +list-recycle-bin.ps1, lists the content of the recycle bin folder list-scripts.ps1, lists all PowerShell scripts in this repository list-services.ps1, lists the services on the local computer list-sql-tables.ps1, lists the SQL server tables diff --git a/README.md b/README.md index 282a0d36..2902425a 100644 --- a/README.md +++ b/README.md @@ -122,6 +122,7 @@ Mega Collection of PowerShell Scripts * [list-empty-files.ps1](Scripts/list-empty-files.ps1) - lists empty files within the given directory tree * [list-files.ps1](Scripts/list-files.ps1) - lists all files in the given folder and also in every subfolder * [list-hidden-files.ps1](Scripts/list-hidden-files.ps1) - lists hidden files within the given directory tree +* [list-recycle-bin.ps1](Scripts/list-recycle-bin.ps1) - lists the content of the recycle bin folder * [list-unused-files.ps1](Scripts/list-unused-files.ps1) - lists unused files in a directory tree * [list-workdir.ps1](Scripts/list-workdir.ps1) - lists the current working directory * [make-install.ps1](Scripts/make-install.ps1) - installs built executables and libs to the installation directory diff --git a/Scripts/list-recycle-bin.ps1 b/Scripts/list-recycle-bin.ps1 new file mode 100755 index 00000000..3b49e806 --- /dev/null +++ b/Scripts/list-recycle-bin.ps1 @@ -0,0 +1,14 @@ +<# +.SYNTAX list-recycle-bin.ps1 +.DESCRIPTION lists the content of the recycle bin folder +.LINK https://github.com/fleschutz/PowerShell +.NOTES Author: Markus Fleschutz / License: CC0 +#> + +try { + (New-Object -ComObject Shell.Application).NameSpace(0x0a).Items() | Select-Object Name,Size,Path + exit 0 +} catch { + write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" + exit 1 +}