Add cd-recycle-bin.ps1

This commit is contained in:
Markus Fleschutz 2021-05-02 11:38:19 +02:00
parent b098205d9c
commit 042f45439d
3 changed files with 19 additions and 0 deletions

View File

@ -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

1 Script Description
10 cd-music.ps1 go to the user's music folder
11 cd-onedrive.ps1 go to the user's OneDrive folder
12 cd-pics.ps1 go to the user's pictures folder
13 cd-recycle-bin.ps1 go to the user's recycle bin folder
14 cd-repos.ps1 go to the user's Git repositories folder
15 cd-root.ps1 go to the root directory (C: on Windows)
16 cd-scripts.ps1 go to the PowerShell Scripts folder

View File

@ -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

View File

@ -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