diff --git a/Data/scripts.csv b/Data/scripts.csv index 2453ac7e..4c58c379 100644 --- a/Data/scripts.csv +++ b/Data/scripts.csv @@ -2,6 +2,15 @@ Script,Description add-firewall-rules.ps1, adds firewall rules to the given executables (needs admin rights) build-repo.ps1, builds the current/given Git repository build-repos.ps1, builds all Git repositories under the current/given directory +cd-desktop.ps1, go to the user's desktop folder +cd-downloads.ps1, go to the user's downloads folder +cd-dropbox.ps1, go to the user's dropbox folder +cd-home.ps1, go to the user's home folder +cd-music.ps1, go to the user's music folder +cd-repos.ps1, go to the user's Git repositories folder +cd-root.ps1, go to the root directory (C: on Windows) +cd-scripts.ps1, go to the PowerShell Scripts folder +cd-up.ps1, go one or multiple directories up check-cpu-temp.ps1, checks the CPU temperature check-dns-resolution.ps1, checks the DNS resolution with frequently used domain names check-drive-space.ps1, checks the given drive for free space left @@ -52,14 +61,6 @@ encrypt-file.ps1, encrypts the given file fetch-repo.ps1, fetches updates for the current/given Git repository (including submodules) fetch-repos.ps1, fetches updates for all Git repositories under the current/given directory (including submodules) generate-qrcode.ps1, generates a QR code -go-desktop.ps1, go to the user's desktop folder -go-downloads.ps1, go to the user's downloads folder -go-dropbox.ps1, go to the user's dropbox folder -go-home.ps1, go to the user's home folder -go-music.ps1, go to the user's music folder -go-repos.ps1, go to the user's Git repositories folder -go-root.ps1, go to the root directory (C: on Windows) -go-scripts.ps1, go to the PowerShell Scripts folder hibernate.ps1, enables hibernate mode for the local computer (needs admin rights) inspect-exe.ps1, prints basic information of the given executable file install-google-chrome.ps1, installs the Google Chrome browser diff --git a/README.md b/README.md index cca9bb1d..3788616e 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,15 @@ Mega Collection of PowerShell Scripts 📁 PowerShell Scripts for Files & Folders ------------------------------------------ +* [cd-desktop.ps1](Scripts/cd-desktop.ps1) - go to the user's desktop folder +* [cd-downloads.ps1](Scripts/cd-downloads.ps1) - go to the user's downloads folder +* [cd-dropbox.ps1](Scripts/cd-dropbox.ps1) - go to the user's dropbox folder +* [cd-home.ps1](Scripts/cd-home.ps1) - go to the user's home folder +* [cd-music.ps1](Scripts/cd-music.ps1) - go to the user's music folder +* [cd-repos.ps1](Scripts/cd-repos.ps1) - go to the user's Git repositories folder +* [cd-root.ps1](Scripts/cd-root.ps1) - go to the root directory (C:\ on Windows) +* [cd-scripts.ps1](Scripts/cd-scripts.ps1) - go to the PowerShell Scripts folder +* [cd-up.ps1](Scripts/cd-up.ps1) - go one or multiple directories up * [check-symlinks.ps1](Scripts/check-symlinks.ps1) - checks every symlink in the given directory tree * [check-xml-file.ps1](Scripts/check-xml-file.ps1) - checks the given XML file for validity * [create-shortcut.ps1](Scripts/create-shortcut.ps1) - creates a shortcut @@ -97,14 +106,6 @@ Mega Collection of PowerShell Scripts * [download-file.ps1](Scripts/download-file.ps1) - downloads a file from the given URL * [edit.ps1](Scripts/edit.ps1) - edits the given file with the built-in text editor * [encrypt-file.ps1](Scripts/encrypt-file.ps1) - encrypts the given file -* [go-desktop.ps1](Scripts/go-desktop.ps1) - go to the user's desktop folder -* [go-downloads.ps1](Scripts/go-downloads.ps1) - go to the user's downloads folder -* [go-dropbox.ps1](Scripts/go-dropbox.ps1) - go to the user's dropbox folder -* [go-home.ps1](Scripts/go-home.ps1) - go to the user's home folder -* [go-music.ps1](Scripts/go-music.ps1) - go to the user's music folder -* [go-repos.ps1](Scripts/go-repos.ps1) - go to the user's Git repositories folder -* [go-root.ps1](Scripts/go-root.ps1) - go to the root directory (C:\ on Windows) -* [go-scripts.ps1](Scripts/go-scripts.ps1) - go to the PowerShell Scripts folder * [inspect-exe.ps1](Scripts/inspect-exe.ps1) - prints basic information of the given executable file * [list-dir.ps1](Scripts/list-dir.ps1) - lists the directory content (formatted in columns) * [list-dir-tree.ps1](Scripts/list-dir-tree.ps1) - lists the directory tree content diff --git a/Scripts/go-desktop.ps1 b/Scripts/cd-desktop.ps1 similarity index 92% rename from Scripts/go-desktop.ps1 rename to Scripts/cd-desktop.ps1 index dccd1b34..4eea52a6 100755 --- a/Scripts/go-desktop.ps1 +++ b/Scripts/cd-desktop.ps1 @@ -1,6 +1,6 @@ #!/usr/bin/pwsh <# -.SYNTAX go-desktop.ps1 +.SYNTAX cd-desktop.ps1 .DESCRIPTION go to the user's desktop folder .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz / License: CC0 diff --git a/Scripts/go-downloads.ps1 b/Scripts/cd-downloads.ps1 similarity index 92% rename from Scripts/go-downloads.ps1 rename to Scripts/cd-downloads.ps1 index 6153a09b..65b2785a 100755 --- a/Scripts/go-downloads.ps1 +++ b/Scripts/cd-downloads.ps1 @@ -1,6 +1,6 @@ #!/usr/bin/pwsh <# -.SYNTAX go-downloads.ps1 +.SYNTAX cd-downloads.ps1 .DESCRIPTION go to the user's downloads folder .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz / License: CC0 diff --git a/Scripts/go-dropbox.ps1 b/Scripts/cd-dropbox.ps1 similarity index 92% rename from Scripts/go-dropbox.ps1 rename to Scripts/cd-dropbox.ps1 index 3f19ab43..11ac62c0 100755 --- a/Scripts/go-dropbox.ps1 +++ b/Scripts/cd-dropbox.ps1 @@ -1,6 +1,6 @@ #!/usr/bin/pwsh <# -.SYNTAX go-dropbox.ps1 +.SYNTAX cd-dropbox.ps1 .DESCRIPTION go to the user's Dropbox folder .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz / License: CC0 diff --git a/Scripts/go-home.ps1 b/Scripts/cd-home.ps1 similarity index 93% rename from Scripts/go-home.ps1 rename to Scripts/cd-home.ps1 index b3813ec4..0d81d491 100755 --- a/Scripts/go-home.ps1 +++ b/Scripts/cd-home.ps1 @@ -1,6 +1,6 @@ #!/usr/bin/pwsh <# -.SYNTAX go-home.ps1 +.SYNTAX cd-home.ps1 .DESCRIPTION go to the user's home folder .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz / License: CC0 diff --git a/Scripts/go-music.ps1 b/Scripts/cd-music.ps1 similarity index 93% rename from Scripts/go-music.ps1 rename to Scripts/cd-music.ps1 index 1c2b7ee0..7c991546 100755 --- a/Scripts/go-music.ps1 +++ b/Scripts/cd-music.ps1 @@ -1,6 +1,6 @@ #!/usr/bin/pwsh <# -.SYNTAX go-music.ps1 +.SYNTAX cd-music.ps1 .DESCRIPTION go to the user's music folder .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz / License: CC0 diff --git a/Scripts/go-repos.ps1 b/Scripts/cd-repos.ps1 similarity index 93% rename from Scripts/go-repos.ps1 rename to Scripts/cd-repos.ps1 index 77f7be99..f987469d 100644 --- a/Scripts/go-repos.ps1 +++ b/Scripts/cd-repos.ps1 @@ -1,6 +1,6 @@ #!/usr/bin/pwsh <# -.SYNTAX go-repos.ps1 +.SYNTAX cd-repos.ps1 .DESCRIPTION go to the user's Git repositories folder .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz / License: CC0 diff --git a/Scripts/go-root.ps1 b/Scripts/cd-root.ps1 similarity index 94% rename from Scripts/go-root.ps1 rename to Scripts/cd-root.ps1 index 55d76dbd..0925ce19 100755 --- a/Scripts/go-root.ps1 +++ b/Scripts/cd-root.ps1 @@ -1,6 +1,6 @@ #!/usr/bin/pwsh <# -.SYNTAX go-root.ps1 +.SYNTAX cd-root.ps1 .DESCRIPTION go to the root directory (C: on Windows) .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz / License: CC0 diff --git a/Scripts/go-scripts.ps1 b/Scripts/cd-scripts.ps1 similarity index 92% rename from Scripts/go-scripts.ps1 rename to Scripts/cd-scripts.ps1 index 4a159505..7b02f76a 100755 --- a/Scripts/go-scripts.ps1 +++ b/Scripts/cd-scripts.ps1 @@ -1,6 +1,6 @@ #!/usr/bin/pwsh <# -.SYNTAX go-scripts.ps1 +.SYNTAX cd-scripts.ps1 .DESCRIPTION go to the PowerShell Scripts folder .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz / License: CC0 diff --git a/Scripts/cd-up.ps1 b/Scripts/cd-up.ps1 new file mode 100755 index 00000000..f54bfa8a --- /dev/null +++ b/Scripts/cd-up.ps1 @@ -0,0 +1,17 @@ +#!/usr/bin/pwsh +<# +.SYNTAX cd-up.ps1 +.DESCRIPTION go one or multiple directories up +.LINK https://github.com/fleschutz/PowerShell +.NOTES Author: Markus Fleschutz / License: CC0 +#> + +try { + $TargetDir = resolve-path ".." + set-location "$TargetDir" + "📂$TargetDir" + exit 0 +} catch { + write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" + exit 1 +}