mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-09 21:07:40 +02:00
Updated the cd-*.ps1 scripts
This commit is contained in:
@ -12,16 +12,17 @@
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
#requires -version 5.1
|
||||
|
||||
try {
|
||||
$path = Resolve-Path "~/.."
|
||||
if (-not(Test-Path "$path" -pathType container)) {
|
||||
throw "No users directory at: $path"
|
||||
}
|
||||
if (-not(Test-Path "$path" -pathType container)) { throw "No users directory at: $path" }
|
||||
|
||||
Set-Location "$path"
|
||||
$folders = Get-ChildItem $path -attributes Directory
|
||||
"📂$path with $($folders.Count) folders entered."
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0])"
|
||||
"⚠️ ERROR: $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
|
Reference in New Issue
Block a user