diff --git a/Data/scripts.csv b/Data/scripts.csv index b5f33907..36fef25e 100644 --- a/Data/scripts.csv +++ b/Data/scripts.csv @@ -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 diff --git a/README.md b/README.md index 4d2b6089..4d57ebc1 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/Scripts/go-downloads.ps1 b/Scripts/go-downloads.ps1 index e16507ef..4cf722fc 100755 --- a/Scripts/go-downloads.ps1 +++ b/Scripts/go-downloads.ps1 @@ -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])" diff --git a/Scripts/go-home.ps1 b/Scripts/go-home.ps1 index acf06a66..aa94ba69 100755 --- a/Scripts/go-home.ps1 +++ b/Scripts/go-home.ps1 @@ -10,6 +10,7 @@ try { $TargetDir = resolve-path "$HOME/" set-location "$TargetDir" "📂 $TargetDir" + "" exit 0 } catch { write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" diff --git a/Scripts/go-music.ps1 b/Scripts/go-music.ps1 index d6790b61..547fa9e1 100755 --- a/Scripts/go-music.ps1 +++ b/Scripts/go-music.ps1 @@ -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])" diff --git a/Scripts/go-repos.ps1 b/Scripts/go-repos.ps1 index 6a6a6405..b2fd3c1d 100644 --- a/Scripts/go-repos.ps1 +++ b/Scripts/go-repos.ps1 @@ -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])" diff --git a/Scripts/go-root.ps1 b/Scripts/go-root.ps1 index daf7f203..7849d3a5 100755 --- a/Scripts/go-root.ps1 +++ b/Scripts/go-root.ps1 @@ -14,6 +14,7 @@ try { } set-location "$TargetDir" "📂 $TargetDir" + "" exit 0 } catch { write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" diff --git a/Scripts/go-scripts.ps1 b/Scripts/go-scripts.ps1 index befda41f..bcca2808 100755 --- a/Scripts/go-scripts.ps1 +++ b/Scripts/go-scripts.ps1 @@ -10,6 +10,7 @@ try { $TargetDir = resolve-path "$PSScriptRoot/" set-location "$TargetDir" "📂 $TargetDir" + "" exit 0 } catch { write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" diff --git a/Scripts/list-workdir.ps1 b/Scripts/list-workdir.ps1 new file mode 100644 index 00000000..60051d08 --- /dev/null +++ b/Scripts/list-workdir.ps1 @@ -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 +} diff --git a/Scripts/my-profile.ps1 b/Scripts/my-profile.ps1 index 7b0455e6..3fdf901d 100755 --- a/Scripts/my-profile.ps1 +++ b/Scripts/my-profile.ps1 @@ -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 +