mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-08 20:54:38 +02:00
Add list-workdir.ps1
This commit is contained in:
@ -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])"
|
||||
|
@ -10,6 +10,7 @@ try {
|
||||
$TargetDir = resolve-path "$HOME/"
|
||||
set-location "$TargetDir"
|
||||
"📂 $TargetDir"
|
||||
""
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
@ -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])"
|
||||
|
@ -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])"
|
||||
|
@ -14,6 +14,7 @@ try {
|
||||
}
|
||||
set-location "$TargetDir"
|
||||
"📂 $TargetDir"
|
||||
""
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
@ -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
17
Scripts/list-workdir.ps1
Normal 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
|
||||
}
|
@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user