Add open-repos-folder.ps1

This commit is contained in:
Markus Fleschutz
2021-10-23 15:57:31 +02:00
parent 9492c2cbda
commit 87bab35a81
5 changed files with 53 additions and 1 deletions

24
Scripts/open-repos-folder.ps1 Executable file
View File

@ -0,0 +1,24 @@
<#
.SYNOPSIS
Opens the Git repositories folder
.DESCRIPTION
This script starts the File Explorer to show the repositories folder.
.EXAMPLE
PS> ./open-repos-folder
.NOTES
Author: Markus Fleschutz · License: CC0
.LINK
https://github.com/fleschutz/PowerShell
#>
try {
$TargetDir = resolve-path "$HOME/Repos"
if (-not(test-path "$TargetDir" -pathType container)) {
throw "Repos folder at 📂$TargetDir doesn't exist (yet)"
}
& "$PSScriptRoot/open-file-explorer.ps1" "$TargetDir"
exit 0 # success
} catch {
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1
}