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

View File

@ -5,9 +5,10 @@ build-repos.ps1, builds all Git repositories under the current/given directory
cd-desktop.ps1, go to the user's desktop folder
cd-docs.ps1, go to the user's documents folder
cd-downloads.ps1, go to the user's downloads folder
cd-dropbox.ps1, go to the user's dropbox folder
cd-dropbox.ps1, go to the user's Dropbox folder
cd-home.ps1, go to the user's home folder
cd-music.ps1, go to the user's music folder
cd-onedrive.ps1, go to the user's OneDrive folder
cd-pics.ps1, go to the user's pictures folder
cd-repos.ps1, go to the user's Git repositories folder
cd-root.ps1, go to the root directory (C: on Windows)

1 Script Description
5 cd-desktop.ps1 go to the user's desktop folder
6 cd-docs.ps1 go to the user's documents folder
7 cd-downloads.ps1 go to the user's downloads folder
8 cd-dropbox.ps1 go to the user's dropbox folder go to the user's Dropbox folder
9 cd-home.ps1 go to the user's home folder
10 cd-music.ps1 go to the user's music folder
11 cd-onedrive.ps1 go to the user's OneDrive folder
12 cd-pics.ps1 go to the user's pictures folder
13 cd-repos.ps1 go to the user's Git repositories folder
14 cd-root.ps1 go to the root directory (C: on Windows)

View File

@ -91,9 +91,10 @@ Mega Collection of PowerShell Scripts
* [cd-desktop.ps1](Scripts/cd-desktop.ps1) - go to the user's desktop folder
* [cd-docs.ps1](Scripts/cd-docs.ps1) - go to the user's documents folder
* [cd-downloads.ps1](Scripts/cd-downloads.ps1) - go to the user's downloads folder
* [cd-dropbox.ps1](Scripts/cd-dropbox.ps1) - go to the user's dropbox folder
* [cd-dropbox.ps1](Scripts/cd-dropbox.ps1) - go to the user's Dropbox folder
* [cd-home.ps1](Scripts/cd-home.ps1) - go to the user's home folder
* [cd-music.ps1](Scripts/cd-music.ps1) - go to the user's music folder
* [cd-onedrive.ps1](Scripts/cd-onedrive.ps1) - go to the user's OneDrive folder
* [cd-pics.ps1](Scripts/cd-pics.ps1) - go to the user's pictures folder
* [cd-repos.ps1](Scripts/cd-repos.ps1) - go to the user's Git repositories folder
* [cd-root.ps1](Scripts/cd-root.ps1) - go to the root directory (C:\ on Windows)

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
}