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

@ -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

1 Script Description
103 list-timezone.ps1 lists the current time zone details
104 list-timezones.ps1 lists all time zones available
105 list-user-groups.ps1 lists the user groups on the local computer
106 list-workdir.ps1 lists the current working directory
107 locate-city.ps1 prints the geographic location of the given city
108 locate-ipaddress.ps1 prints the geographic location of the given IP address
109 locate-zip-code.ps1 prints the geographic location of the given zip-code

View File

@ -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

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