diff --git a/Data/scripts.csv b/Data/scripts.csv index b415489c..9fcbfbd8 100644 --- a/Data/scripts.csv +++ b/Data/scripts.csv @@ -10,6 +10,7 @@ cd-home.ps1, go to the user's home folder cd-music.ps1, go to the user's music folder cd-onedrive.ps1, go to the user's OneDrive folder cd-pics.ps1, go to the user's pictures folder +cd-recycle-bin.ps1, go to the user's recycle bin folder cd-repos.ps1, go to the user's Git repositories folder cd-root.ps1, go to the root directory (C: on Windows) cd-scripts.ps1, go to the PowerShell Scripts folder diff --git a/README.md b/README.md index 2af90a29..06997f11 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,7 @@ Mega Collection of PowerShell Scripts * [cd-music.ps1](Scripts/cd-music.ps1) - go to the user's music folder * [cd-onedrive.ps1](Scripts/cd-onedrive.ps1) - go to the user's OneDrive folder * [cd-pics.ps1](Scripts/cd-pics.ps1) - go to the user's pictures folder +* [cd-recycle-bin.ps1](Scripts/cd-recycle-bin.ps1) - go to the user's recycle bin folder * [cd-repos.ps1](Scripts/cd-repos.ps1) - go to the user's Git repositories folder * [cd-root.ps1](Scripts/cd-root.ps1) - go to the root directory (C:\ on Windows) * [cd-scripts.ps1](Scripts/cd-scripts.ps1) - go to the PowerShell Scripts folder diff --git a/Scripts/cd-recycle-bin.ps1 b/Scripts/cd-recycle-bin.ps1 new file mode 100644 index 00000000..2bef6cb1 --- /dev/null +++ b/Scripts/cd-recycle-bin.ps1 @@ -0,0 +1,17 @@ +<# +.SYNTAX cd-recycle-bin.ps1 +.DESCRIPTION go to the user's recycle bin folder +.LINK https://github.com/fleschutz/PowerShell +.NOTES Author: Markus Fleschutz / License: CC0 +#> + +function Get-CurrentUserSID { [CmdletBinding()] param() + Add-Type -AssemblyName System.DirectoryServices.AccountManagement + return ([System.DirectoryServices.AccountManagement.UserPrincipal]::Current).SID.Value +} + + +$TargetDir = 'C:\$Recycle.Bin\' + "$(Get-CurrentUserSID)" +set-location "$TargetDir" +"📂$TargetDir" +exit 0