mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-05-10 02:24:58 +02:00
Updated cd-repos.ps1 and cd-scripts.ps1
This commit is contained in:
parent
5873d0dc1c
commit
225a1ae902
@ -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, it has $($subfolders.Count) subfolders."
|
"📂$path entered, containing $($subfolders.Count) subfolders."
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
"⚠️ Error: $($Error[0])"
|
"⚠️ Error: $($Error[0])"
|
||||||
|
@ -15,8 +15,9 @@
|
|||||||
try {
|
try {
|
||||||
$path = Resolve-Path "$PSScriptRoot"
|
$path = Resolve-Path "$PSScriptRoot"
|
||||||
if (-not(Test-Path "$path" -pathType container)) { throw "PowerShell scripts folder at 📂$path doesn't exist (yet)" }
|
if (-not(Test-Path "$path" -pathType container)) { throw "PowerShell scripts folder at 📂$path doesn't exist (yet)" }
|
||||||
|
$files = Get-ChildItem $path -attributes !Directory
|
||||||
|
"📂$path entered, containing $($files.Count) scripts."
|
||||||
Set-Location "$path"
|
Set-Location "$path"
|
||||||
"📂$path"
|
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
Loading…
Reference in New Issue
Block a user