Updated the cd-*.ps1 scripts

This commit is contained in:
Markus Fleschutz
2025-07-09 14:19:53 +02:00
parent d3e77308a8
commit 51b541e0de
30 changed files with 115 additions and 65 deletions

View File

@ -2,7 +2,7 @@
.SYNOPSIS
Sets the working directory to the PowerShell scripts folder
.DESCRIPTION
This PowerShell script changes the working directory to the PowerShell scripts folder.
This PowerShell script changes the currrent working directory to the PowerShell scripts folder.
.EXAMPLE
PS> ./cd-scripts.ps1
📂C:\Repos\PowerShell\scripts with 655 scripts entered.
@ -12,6 +12,8 @@
Author: Markus Fleschutz | License: CC0
#>
#requires -version 5.1
try {
$path = Resolve-Path "$PSScriptRoot"
if (-not(Test-Path "$path" -pathType container)) { throw "No scripts folder at: $path" }
@ -20,6 +22,6 @@ try {
"📂$path with $($files.Count) scripts entered."
exit 0 # success
} catch {
"⚠️ Error: $($Error[0])"
"⚠️ ERROR: $($Error[0])"
exit 1
}