Add go-desktop.ps1 and go-dropbox.ps1

This commit is contained in:
Markus Fleschutz
2021-04-18 17:45:02 +02:00
parent f83042c654
commit 42512ee54a
10 changed files with 45 additions and 7 deletions

17
Scripts/go-desktop.ps1 Executable file
View File

@ -0,0 +1,17 @@
#!/usr/bin/pwsh
<#
.SYNTAX go-desktop.ps1
.DESCRIPTION go to the user's desktop folder
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
try {
$TargetDir = resolve-path "$HOME/Desktop/"
set-location "$TargetDir"
"📂$TargetDir"
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

View File

@ -9,7 +9,7 @@
try {
$TargetDir = resolve-path "$HOME/Downloads/"
set-location "$TargetDir"
" 📂$TargetDir"
"📂$TargetDir"
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

17
Scripts/go-dropbox.ps1 Executable file
View File

@ -0,0 +1,17 @@
#!/usr/bin/pwsh
<#
.SYNTAX go-dropbox.ps1
.DESCRIPTION go to the user's Dropbox folder
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
try {
$TargetDir = resolve-path "$HOME/Dropbox/"
set-location "$TargetDir"
"📂$TargetDir"
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

View File

@ -9,7 +9,7 @@
try {
$TargetDir = resolve-path "$HOME/"
set-location "$TargetDir"
" 📂$TargetDir"
"📂$TargetDir"
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

View File

@ -9,7 +9,7 @@
try {
$TargetDir = resolve-path "$HOME/Music/"
set-location "$TargetDir"
" 📂$TargetDir"
"📂$TargetDir"
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

View File

@ -9,7 +9,7 @@
try {
$TargetDir = resolve-path "$HOME/Repos/"
set-location "$TargetDir"
" 📂$TargetDir"
"📂$TargetDir"
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

View File

@ -13,7 +13,7 @@ try {
$TargetDir = resolve-path "C:/"
}
set-location "$TargetDir"
" 📂$TargetDir"
"📂$TargetDir"
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

View File

@ -9,7 +9,7 @@
try {
$TargetDir = resolve-path "$PSScriptRoot/"
set-location "$TargetDir"
" 📂$TargetDir"
"📂$TargetDir"
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"