mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-05-09 10:04:45 +02:00
Updated cd-repos.ps1
This commit is contained in:
parent
edc57b01ef
commit
5873d0dc1c
@ -1,6 +1,6 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Sets the working directory to the Git repos folder
|
||||
Sets the working dir to the repos folder
|
||||
.DESCRIPTION
|
||||
This PowerShell script changes the working directory to the folder for Git repositories.
|
||||
.EXAMPLE
|
||||
@ -24,11 +24,12 @@ try {
|
||||
} elseif (Test-Path "~/source/repos" -pathType container) { $path = "~/source/repos" # Visual Studio default
|
||||
} elseif (Test-Path "D:/Repos" -pathType container) { $path = "D:/Repos" # second HDD
|
||||
} else {
|
||||
throw "No folder for Git repositories yet (in home or root directory)"
|
||||
throw "No folder found for Git repositories (in home or root directory) - Please create one."
|
||||
}
|
||||
$path = Resolve-Path $path
|
||||
Set-Location "$path"
|
||||
"📂$path"
|
||||
$subfolders = Get-ChildItem $path -attributes Directory
|
||||
"📂$path entered, it has $($subfolders.Count) subfolders."
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0])"
|
||||
|
Loading…
Reference in New Issue
Block a user