Updated cd-repos.ps1 and new-symlink.ps1

This commit is contained in:
Markus Fleschutz
2025-01-08 15:51:28 +01:00
parent f1a20bc962
commit 9cf0ecacb3
2 changed files with 12 additions and 7 deletions

View File

@ -1,13 +1,13 @@
<#
.SYNOPSIS
Sets the working directory to the user's repos folder
Sets the working directory to the Git repos folder
.DESCRIPTION
This PowerShell script changes the working directory to the user's Git repositories folder.
This PowerShell script changes the working directory to the Git repositories folder.
.PARAMETER subpath
Specifies an additional relative subpath (optional)
.EXAMPLE
PS> ./cd-repos.ps1
📂C:\Users\Markus\Repos
📂C:\Repos
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
@ -25,6 +25,10 @@ try {
$path = "~/source/repos/"
} elseif (Test-Path "/Repos/" -pathType Container) {
$path = "/Repos/"
} elseif (Test-Path "C:/Repos" -pathType Container) {
$path = "C:/Repos"
} elseif (Test-Path "C:/Repositories" -pathType Container) {
$path = "C:/Repositories"
} else {
throw "The folder for Git repositories doesn't exist (yet)"
}