Update cd-repos.ps1

This commit is contained in:
Markus Fleschutz 2022-11-06 22:42:04 +01:00
parent 26ad83c417
commit c72e01facb

View File

@ -5,7 +5,7 @@
This PowerShell script changes the working directory to the user's Git repositories folder.
.EXAMPLE
PS> ./cd-repos
📂C:\Users\Markus\Repos
📂C:\Users\Markus\source\repos
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
@ -13,13 +13,9 @@
#>
try {
$Path = Resolve-Path "$HOME/Repos"
$Path = Resolve-Path "$HOME/source/repos"
if (-not(Test-Path "$Path" -pathType container)) {
$Path = Resolve-Path "$HOME/source/repos"
if (-not(Test-Path "$Path" -pathType container)) {
$Path = Resolve-Path "$HOME/Repos"
throw "Folder for Git repositories at 📂$Path doesn't exist (yet)"
}
throw "Folder for Git repositories at 📂$Path doesn't exist (yet)"
}
Set-Location "$Path"
"📂$Path"