mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-03-25 05:26:47 +01:00
Add list-workdir.ps1
This commit is contained in:
parent
f78a9390cb
commit
fbec2c8587
@ -103,6 +103,7 @@ list-tasks.ps1, lists all Windows scheduler tasks
|
||||
list-timezone.ps1, lists the current time zone details
|
||||
list-timezones.ps1, lists all time zones available
|
||||
list-user-groups.ps1, lists the user groups on the local computer
|
||||
list-workdir.ps1, lists the current working directory
|
||||
locate-city.ps1, prints the geographic location of the given city
|
||||
locate-ipaddress.ps1, prints the geographic location of the given IP address
|
||||
locate-zip-code.ps1, prints the geographic location of the given zip-code
|
||||
|
|
@ -109,6 +109,7 @@ Mega Collection of PowerShell Scripts
|
||||
* [list-formatted.ps1](Scripts/list-formatted.ps1) - lists the current working directory formatted in columns
|
||||
* [list-hidden-files.ps1](Scripts/list-hidden-files.ps1) - lists hidden files within the given directory tree
|
||||
* [list-unused-files.ps1](Scripts/list-unused-files.ps1) - lists unused files in a directory tree
|
||||
* [list-workdir.ps1](Scripts/list-workdir.ps1) - lists the current working directory
|
||||
* [make-install.ps1](Scripts/make-install.ps1) - installs built executables and libs to the installation directory
|
||||
* [MD5.ps1](Scripts/MD5.ps1) - prints the MD5 checksum of the given file
|
||||
* [remove-empty-dirs.ps1](Scripts/remove-empty-dirs.ps1) - removes empty subfolders within the given directory tree
|
||||
|
@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user