mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-01-13 09:28:22 +01:00
Improve the scripts
This commit is contained in:
parent
2030dc3820
commit
76e6cc1118
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/pwsh
|
||||
#!/usr/bin/pwsh
|
||||
<#
|
||||
.SYNTAX go-downloads.ps1
|
||||
.DESCRIPTION go to the user's downloads folder
|
||||
@ -7,7 +7,9 @@
|
||||
#>
|
||||
|
||||
try {
|
||||
set-location $HOME/Downloads/
|
||||
$TargetDir = resolve-path "$HOME/Downloads/"
|
||||
set-location "$TargetDir"
|
||||
"📂 $TargetDir"
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/pwsh
|
||||
#!/usr/bin/pwsh
|
||||
<#
|
||||
.SYNTAX go-home.ps1
|
||||
.DESCRIPTION go to the user's home folder
|
||||
@ -7,7 +7,9 @@
|
||||
#>
|
||||
|
||||
try {
|
||||
set-location $HOME
|
||||
$TargetDir = resolve-path "$HOME/"
|
||||
set-location "$TargetDir"
|
||||
"📂 $TargetDir"
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/pwsh
|
||||
#!/usr/bin/pwsh
|
||||
<#
|
||||
.SYNTAX go-music.ps1
|
||||
.DESCRIPTION go to the user's music folder
|
||||
@ -7,7 +7,9 @@
|
||||
#>
|
||||
|
||||
try {
|
||||
set-location $HOME/Music/
|
||||
$TargetDir = resolve-path "$HOME/Music/"
|
||||
set-location "$TargetDir"
|
||||
"📂 $TargetDir"
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/pwsh
|
||||
#!/usr/bin/pwsh
|
||||
<#
|
||||
.SYNTAX go-repos.ps1
|
||||
.DESCRIPTION go to the user's Git repositories folder
|
||||
@ -7,7 +7,9 @@
|
||||
#>
|
||||
|
||||
try {
|
||||
set-location $HOME/Repos/
|
||||
$TargetDir = resolve-path "$HOME/Repos/"
|
||||
set-location "$TargetDir"
|
||||
"📂 $TargetDir"
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/pwsh
|
||||
#!/usr/bin/pwsh
|
||||
<#
|
||||
.SYNTAX go-root.ps1
|
||||
.DESCRIPTION go to the root directory (C: on Windows)
|
||||
@ -8,10 +8,12 @@
|
||||
|
||||
try {
|
||||
if ($IsLinux) {
|
||||
set-location /
|
||||
$TargetDir = resolve-path "/"
|
||||
} else {
|
||||
set-location C:
|
||||
$TargetDir = resolve-path "C:/"
|
||||
}
|
||||
set-location "$TargetDir"
|
||||
"📂 $TargetDir"
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/pwsh
|
||||
#!/usr/bin/pwsh
|
||||
<#
|
||||
.SYNTAX go-scripts.ps1
|
||||
.DESCRIPTION go to the PowerShell Scripts folder
|
||||
@ -7,7 +7,9 @@
|
||||
#>
|
||||
|
||||
try {
|
||||
set-location $PSScriptRoot
|
||||
$TargetDir = resolve-path "$PSScriptRoot/"
|
||||
set-location "$TargetDir"
|
||||
"📂 $TargetDir"
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
Loading…
Reference in New Issue
Block a user