mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-09 21:07:40 +02:00
Add cd-recycle-bin.ps1
This commit is contained in:
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
|
Reference in New Issue
Block a user