Add list-workdir.ps1

This commit is contained in:
Markus Fleschutz
2021-04-18 10:34:46 +02:00
parent f78a9390cb
commit fbec2c8587
10 changed files with 28 additions and 2 deletions

View File

@ -10,6 +10,7 @@ try {
$TargetDir = resolve-path "$HOME/Downloads/"
set-location "$TargetDir"
"📂 $TargetDir"
""
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

View File

@ -10,6 +10,7 @@ try {
$TargetDir = resolve-path "$HOME/"
set-location "$TargetDir"
"📂 $TargetDir"
""
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

View File

@ -10,6 +10,7 @@ try {
$TargetDir = resolve-path "$HOME/Music/"
set-location "$TargetDir"
"📂 $TargetDir"
""
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

View File

@ -10,6 +10,7 @@ try {
$TargetDir = resolve-path "$HOME/Repos/"
set-location "$TargetDir"
"📂 $TargetDir"
""
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

View File

@ -14,6 +14,7 @@ try {
}
set-location "$TargetDir"
"📂 $TargetDir"
""
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

View File

@ -10,6 +10,7 @@ try {
$TargetDir = resolve-path "$PSScriptRoot/"
set-location "$TargetDir"
"📂 $TargetDir"
""
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

17
Scripts/list-workdir.ps1 Normal file
View File

@ -0,0 +1,17 @@
#!/usr/bin/pwsh
<#
.SYNTAX list-workdir.ps1
.DESCRIPTION lists the current working directory
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
try {
$CWD = resolve-path "$PWD/"
"📂 $CWD"
""
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

View File

@ -15,7 +15,6 @@ write-host ""
# My Command Prompt
# -----------------
# function prompt {$null} # result is: PS>
# function prompt { "$ " } # result is: $
@ -25,8 +24,10 @@ function prompt { return "💲 " } # result is: 💲
# My Alias Names (sorted alphabetically)
# --------------
set-alias -name cwd -value list-workdir.ps1 # cwd = current working directory
set-alias -name ll -value get-childitem # ll = list long
set-alias -name lsf -value list-formatted.ps1 # lsf = list directory formatted in columns
set-alias -name lsf -value list-formatted.ps1 # lsf = list directory formatted