Add cd-onedrive.ps1

This commit is contained in:
Markus
2021-04-21 18:58:21 +02:00
parent df4db74657
commit 5706a11bdd
3 changed files with 21 additions and 2 deletions

17
Scripts/cd-onedrive.ps1 Normal file
View File

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