mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-22 01:48:20 +02:00
Add cd-recycle-bin.ps1
This commit is contained in:
parent
b098205d9c
commit
042f45439d
@ -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-music.ps1, go to the user's music folder
|
||||||
cd-onedrive.ps1, go to the user's OneDrive folder
|
cd-onedrive.ps1, go to the user's OneDrive folder
|
||||||
cd-pics.ps1, go to the user's pictures 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-repos.ps1, go to the user's Git repositories folder
|
||||||
cd-root.ps1, go to the root directory (C: on Windows)
|
cd-root.ps1, go to the root directory (C: on Windows)
|
||||||
cd-scripts.ps1, go to the PowerShell Scripts folder
|
cd-scripts.ps1, go to the PowerShell Scripts folder
|
||||||
|
|
@ -99,6 +99,7 @@ Mega Collection of PowerShell Scripts
|
|||||||
* [cd-music.ps1](Scripts/cd-music.ps1) - go to the user's music folder
|
* [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-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-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-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-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
|
* [cd-scripts.ps1](Scripts/cd-scripts.ps1) - go to the PowerShell Scripts folder
|
||||||
|
17
Scripts/cd-recycle-bin.ps1
Normal file
17
Scripts/cd-recycle-bin.ps1
Normal 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
|
Loading…
Reference in New Issue
Block a user