Updated cd-repos.ps1

This commit is contained in:
Markus Fleschutz 2025-03-27 08:37:13 +01:00
parent ec33cb8829
commit be820bb0cf

View File

@ -5,7 +5,7 @@
This PowerShell script changes the working directory to the folder for Git repositories. This PowerShell script changes the working directory to the folder for Git repositories.
.EXAMPLE .EXAMPLE
PS> ./cd-repos.ps1 PS> ./cd-repos.ps1
📂C:\Repos 📂C:\Repos (has 33 subfolders)
.LINK .LINK
https://github.com/fleschutz/PowerShell https://github.com/fleschutz/PowerShell
.NOTES .NOTES
@ -29,7 +29,7 @@ try {
$path = Resolve-Path $path $path = Resolve-Path $path
Set-Location "$path" Set-Location "$path"
$subfolders = Get-ChildItem $path -attributes Directory $subfolders = Get-ChildItem $path -attributes Directory
"📂$path entered (has $($subfolders.Count) subfolders)." "📂$path entered (has $($subfolders.Count) subfolders)"
exit 0 # success exit 0 # success
} catch { } catch {
"⚠️ Error: $($Error[0])" "⚠️ Error: $($Error[0])"