Add cd-up.ps1

This commit is contained in:
Markus Fleschutz 2021-04-21 07:29:52 +02:00
parent 89a44fc88f
commit 6daa6a19ca
11 changed files with 43 additions and 24 deletions

View File

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

1 Script Description
2 add-firewall-rules.ps1 adds firewall rules to the given executables (needs admin rights)
3 build-repo.ps1 builds the current/given Git repository
4 build-repos.ps1 builds all Git repositories under the current/given directory
5 cd-desktop.ps1 go to the user's desktop folder
6 cd-downloads.ps1 go to the user's downloads folder
7 cd-dropbox.ps1 go to the user's dropbox folder
8 cd-home.ps1 go to the user's home folder
9 cd-music.ps1 go to the user's music folder
10 cd-repos.ps1 go to the user's Git repositories folder
11 cd-root.ps1 go to the root directory (C: on Windows)
12 cd-scripts.ps1 go to the PowerShell Scripts folder
13 cd-up.ps1 go one or multiple directories up
14 check-cpu-temp.ps1 checks the CPU temperature
15 check-dns-resolution.ps1 checks the DNS resolution with frequently used domain names
16 check-drive-space.ps1 checks the given drive for free space left
61 fetch-repo.ps1 fetches updates for the current/given Git repository (including submodules)
62 fetch-repos.ps1 fetches updates for all Git repositories under the current/given directory (including submodules)
63 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
64 hibernate.ps1 enables hibernate mode for the local computer (needs admin rights)
65 inspect-exe.ps1 prints basic information of the given executable file
66 install-google-chrome.ps1 installs the Google Chrome browser

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

17
Scripts/cd-up.ps1 Executable file
View File

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