Add go-root.ps1

This commit is contained in:
Markus Fleschutz
2021-03-15 08:00:38 +01:00
parent 01df13393a
commit 8b608c57a2
3 changed files with 21 additions and 0 deletions

19
Scripts/go-root.ps1 Executable file
View 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
}