mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-23 08:23:14 +01:00
Add go-root.ps1
This commit is contained in:
parent
01df13393a
commit
8b608c57a2
@ -34,6 +34,7 @@ generate-qrcode.ps1, generates a QR code
|
|||||||
go-downloads.ps1, go to the user's downloads folder
|
go-downloads.ps1, go to the user's downloads folder
|
||||||
go-home.ps1, go to the user's home folder
|
go-home.ps1, go to the user's home folder
|
||||||
go-music.ps1, go to the user's music folder
|
go-music.ps1, go to the user's music folder
|
||||||
|
go-root.ps1, go to the root directory (C: on Windows)
|
||||||
go-scripts.ps1, go to the PowerShell Scripts folder
|
go-scripts.ps1, go to the PowerShell Scripts folder
|
||||||
hibernate.ps1, enables hibernate mode for the local computer (requires admin rights)
|
hibernate.ps1, enables hibernate mode for the local computer (requires admin rights)
|
||||||
inspect-exe.ps1, prints basic information of the given executable file
|
inspect-exe.ps1, prints basic information of the given executable file
|
||||||
|
|
@ -78,6 +78,7 @@ Collection of PowerShell Scripts
|
|||||||
* [go-downloads.ps1](Scripts/go-downloads.ps1) - go to the user's downloads folder
|
* [go-downloads.ps1](Scripts/go-downloads.ps1) - go to the user's downloads folder
|
||||||
* [go-home.ps1](Scripts/go-home.ps1) - go to the user's home 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-music.ps1](Scripts/go-music.ps1) - go to the user's music 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
|
* [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
|
* [inspect-exe.ps1](Scripts/inspect-exe.ps1) - prints basic information of the given executable file
|
||||||
* [list-empty-dirs.ps1](Scripts/list-empty-dirs.ps1) - lists empty subfolders within the given directory tree
|
* [list-empty-dirs.ps1](Scripts/list-empty-dirs.ps1) - lists empty subfolders within the given directory tree
|
||||||
|
19
Scripts/go-root.ps1
Executable file
19
Scripts/go-root.ps1
Executable file
@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/powershell
|
||||||
|
<#
|
||||||
|
.SYNTAX ./go-root.ps1
|
||||||
|
.DESCRIPTION go to the root directory (C: on Windows)
|
||||||
|
.LINK https://github.com/fleschutz/PowerShell
|
||||||
|
.NOTES Author: Markus Fleschutz / License: CC0
|
||||||
|
#>
|
||||||
|
|
||||||
|
try {
|
||||||
|
if ($IsLinux) {
|
||||||
|
set-location /
|
||||||
|
} else {
|
||||||
|
set-location C:
|
||||||
|
}
|
||||||
|
exit 0
|
||||||
|
} catch {
|
||||||
|
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
exit 1
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user