Updated the cd-*.ps1 scripts

This commit is contained in:
Markus Fleschutz
2024-10-30 13:19:56 +01:00
parent 6419712ff2
commit bb01ef8cf5
25 changed files with 117 additions and 117 deletions

View File

@ -14,16 +14,16 @@
try {
if ($IsLinux) {
$Path = Resolve-Path "~/Downloads"
$path = Resolve-Path "~/Downloads"
} else {
$Path = (New-Object -ComObject Shell.Application).NameSpace('shell:Downloads').Self.Path
$path = (New-Object -ComObject Shell.Application).NameSpace('shell:Downloads').Self.Path
}
if (Test-Path "$Path" -pathType container) {
Set-Location "$Path"
"📂$Path"
if (Test-Path "$path" -pathType container) {
Set-Location "$path"
"📂$path"
exit 0 # success
}
throw "User's downloads folder at 📂$Path doesn't exist (yet)"
throw "User's downloads folder at 📂$path doesn't exist (yet)"
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1