From f07931b8b43f6520c5da930c89743c106200dc71 Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Sat, 23 Oct 2021 16:18:45 +0200 Subject: [PATCH] Add open-dropbox-folder.ps1 --- Data/scripts.csv | 1 + Docs/open-downloads-folder.md | 4 ++-- Docs/open-dropbox-folder.md | 26 ++++++++++++++++++++++++++ Docs/open-home-folder.md | 2 +- Docs/open-music-folder.md | 2 +- Docs/open-recycle-bin.md | 4 ++-- Docs/open-repos-folder.md | 2 +- Docs/open-videos-folders.md | 4 ++-- README.md | 1 + Scripts/open-downloads-folder.ps1 | 4 ++-- Scripts/open-dropbox-folder.ps1 | 24 ++++++++++++++++++++++++ Scripts/open-home-folder.ps1 | 2 +- Scripts/open-music-folder.ps1 | 2 +- Scripts/open-recycle-bin.ps1 | 4 ++-- Scripts/open-repos-folder.ps1 | 2 +- Scripts/open-videos-folders.ps1 | 4 ++-- 16 files changed, 70 insertions(+), 18 deletions(-) create mode 100644 Docs/open-dropbox-folder.md create mode 100755 Scripts/open-dropbox-folder.ps1 diff --git a/Data/scripts.csv b/Data/scripts.csv index 88df0440..f754c81f 100644 --- a/Data/scripts.csv +++ b/Data/scripts.csv @@ -159,6 +159,7 @@ mute-audio.ps1, Mutes the audio device open-browser.ps1, Starts the default Web browser open-calculator.ps1, Starts the calculator program open-downloads-folder.ps1, Opens the user's downloads folder +open-dropbox-folder.ps1, Opens the user's Dropbox folder open-email-client.ps1, Starts the default email client open-file-explorer.ps1, Opens the File Explorer open-home-folder.ps1, Opens the user's home folder diff --git a/Docs/open-downloads-folder.md b/Docs/open-downloads-folder.md index ae3fa69e..eca0ea2e 100644 --- a/Docs/open-downloads-folder.md +++ b/Docs/open-downloads-folder.md @@ -1,6 +1,6 @@ -## open-downloads-folder.ps1 - Opens the downloads folder +## open-downloads-folder.ps1 - Opens the user's downloads folder -This script starts the File Explorer to show the downloads folder. +This script starts the File Explorer and shows the user's downloads folder. ## Parameters ```powershell diff --git a/Docs/open-dropbox-folder.md b/Docs/open-dropbox-folder.md new file mode 100644 index 00000000..90019905 --- /dev/null +++ b/Docs/open-dropbox-folder.md @@ -0,0 +1,26 @@ +## open-dropbox-folder.ps1 - Opens the user's Dropbox folder + +This script starts the File Explorer and shows the user's Dropbox folder. + +## Parameters +```powershell +open-dropbox-folder.ps1 [] + +[] + This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, + WarningVariable, OutBuffer, PipelineVariable, and OutVariable. +``` + +## Example +```powershell +PS> ./open-dropbox-folder + +``` + +## Notes +Author: Markus Fleschutz · License: CC0 + +## Related Links +https://github.com/fleschutz/PowerShell + +*Generated by convert-ps2md.ps1 using the comment-based help of open-dropbox-folder.ps1* diff --git a/Docs/open-home-folder.md b/Docs/open-home-folder.md index 6b19c865..1660b661 100644 --- a/Docs/open-home-folder.md +++ b/Docs/open-home-folder.md @@ -1,6 +1,6 @@ ## open-home-folder.ps1 - Opens the home folder -This script starts the File Explorer to show the home folder. +This script starts the File Explorer and shows the home folder. ## Parameters ```powershell diff --git a/Docs/open-music-folder.md b/Docs/open-music-folder.md index bb708011..1ecf10b3 100644 --- a/Docs/open-music-folder.md +++ b/Docs/open-music-folder.md @@ -1,6 +1,6 @@ ## open-music-folder.ps1 - Opens the music folder -This script starts the File Explorer to show the music folder. +This script starts the File Explorer and shows the music folder. ## Parameters ```powershell diff --git a/Docs/open-recycle-bin.md b/Docs/open-recycle-bin.md index bc953268..a7f13b21 100644 --- a/Docs/open-recycle-bin.md +++ b/Docs/open-recycle-bin.md @@ -1,6 +1,6 @@ -## open-recycle-bin.ps1 - Starts the File Explorer with the recycle bin folder +## open-recycle-bin.ps1 - Opens the user's recycle bin folder -This script starts the File Explorer with the recycle bin folder. +This script starts the File Explorer and shows the user's recycle bin folder. ## Parameters ```powershell diff --git a/Docs/open-repos-folder.md b/Docs/open-repos-folder.md index b5c3834b..39c0e68e 100644 --- a/Docs/open-repos-folder.md +++ b/Docs/open-repos-folder.md @@ -1,6 +1,6 @@ ## open-repos-folder.ps1 - Opens the Git repositories folder -This script starts the File Explorer to show the repositories folder. +This script starts the File Explorer and shows the user's Git repositories folder. ## Parameters ```powershell diff --git a/Docs/open-videos-folders.md b/Docs/open-videos-folders.md index 46f060e4..e6f5ce32 100644 --- a/Docs/open-videos-folders.md +++ b/Docs/open-videos-folders.md @@ -1,6 +1,6 @@ -## open-videos-folders.ps1 - Opens the File Explorer with the videos folder +## open-videos-folders.ps1 - Opens the user's videos folder -This script starts the File Explorer to show the home folder. +This script starts the File Explorer and shows the user's videos folder. ## Parameters ```powershell diff --git a/README.md b/README.md index da2ecc8a..8de99031 100644 --- a/README.md +++ b/README.md @@ -114,6 +114,7 @@ Mega Collection of PowerShell Scripts | [open-browser.ps1](Scripts/open-browser.ps1) | Starts the default Web browser | [Help](Docs/open-browser.md) | | [open-calculator.ps1](Scripts/open-calculator.ps1) | Starts the calculator program | [Help](Docs/open-calculator.md) | | [open-downloads-folders.ps1](Scripts/open-downloads-folder.ps1) | Opens the user's downloads folder | [Help](Docs/open-downloads-folder.md) | +| [open-dropbox-folder.ps1](Scripts/open-dropbox-folder.ps1) | Opens the user's Dropbox folder | [Help](Docs/open-dropbox-folder.md) | | [open-email-client.ps1](Scripts/open-browser.ps1) | Starts the default email client | [Help](Docs/open-email-client.md) | | [open-file-explorer.ps1](Scripts/open-file-explorer.ps1) | Opens the File Explorer | [Help](Docs/open-file-explorer.md) | | [open-home-folder.ps1](Scripts/open-home-folder.ps1) | Opens the user's home folder | [Help](Docs/open-home-folder.md) | diff --git a/Scripts/open-downloads-folder.ps1 b/Scripts/open-downloads-folder.ps1 index 369cc7d7..5a39916c 100755 --- a/Scripts/open-downloads-folder.ps1 +++ b/Scripts/open-downloads-folder.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - Opens the downloads folder + Opens the user's downloads folder .DESCRIPTION - This script starts the File Explorer to show the downloads folder. + This script starts the File Explorer and shows the user's downloads folder. .EXAMPLE PS> ./open-downloads-folder .NOTES diff --git a/Scripts/open-dropbox-folder.ps1 b/Scripts/open-dropbox-folder.ps1 new file mode 100755 index 00000000..fb8beb2b --- /dev/null +++ b/Scripts/open-dropbox-folder.ps1 @@ -0,0 +1,24 @@ +<# +.SYNOPSIS + Opens the user's Dropbox folder +.DESCRIPTION + This script starts the File Explorer and shows the user's Dropbox folder. +.EXAMPLE + PS> ./open-dropbox-folder +.NOTES + Author: Markus Fleschutz · License: CC0 +.LINK + https://github.com/fleschutz/PowerShell +#> + +try { + $TargetDir = resolve-path "$HOME/Dropbox" + if (-not(test-path "$TargetDir" -pathType container)) { + throw "Dropbox folder at 📂$TargetDir doesn't exist (yet)" + } + & "$PSScriptRoot/open-file-explorer.ps1" "$TargetDir" + exit 0 # success +} catch { + "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))" + exit 1 +} diff --git a/Scripts/open-home-folder.ps1 b/Scripts/open-home-folder.ps1 index fd2fe854..933964c8 100755 --- a/Scripts/open-home-folder.ps1 +++ b/Scripts/open-home-folder.ps1 @@ -2,7 +2,7 @@ .SYNOPSIS Opens the home folder .DESCRIPTION - This script starts the File Explorer to show the home folder. + This script starts the File Explorer and shows the home folder. .EXAMPLE PS> ./open-home-folder .NOTES diff --git a/Scripts/open-music-folder.ps1 b/Scripts/open-music-folder.ps1 index fdcd4ebe..b0fc4077 100755 --- a/Scripts/open-music-folder.ps1 +++ b/Scripts/open-music-folder.ps1 @@ -2,7 +2,7 @@ .SYNOPSIS Opens the music folder .DESCRIPTION - This script starts the File Explorer to show the music folder. + This script starts the File Explorer and shows the music folder. .EXAMPLE PS> ./open-music-folder .NOTES diff --git a/Scripts/open-recycle-bin.ps1 b/Scripts/open-recycle-bin.ps1 index 7db2c272..0ccfbc2c 100755 --- a/Scripts/open-recycle-bin.ps1 +++ b/Scripts/open-recycle-bin.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - Starts the File Explorer with the recycle bin folder + Opens the user's recycle bin folder .DESCRIPTION - This script starts the File Explorer with the recycle bin folder. + This script starts the File Explorer and shows the user's recycle bin folder. .EXAMPLE PS> ./open-recycle-bin .NOTES diff --git a/Scripts/open-repos-folder.ps1 b/Scripts/open-repos-folder.ps1 index 6ce8e6d0..a0b592a9 100755 --- a/Scripts/open-repos-folder.ps1 +++ b/Scripts/open-repos-folder.ps1 @@ -2,7 +2,7 @@ .SYNOPSIS Opens the Git repositories folder .DESCRIPTION - This script starts the File Explorer to show the repositories folder. + This script starts the File Explorer and shows the user's Git repositories folder. .EXAMPLE PS> ./open-repos-folder .NOTES diff --git a/Scripts/open-videos-folders.ps1 b/Scripts/open-videos-folders.ps1 index 72056609..274b49d0 100755 --- a/Scripts/open-videos-folders.ps1 +++ b/Scripts/open-videos-folders.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - Opens the File Explorer with the videos folder + Opens the user's videos folder .DESCRIPTION - This script starts the File Explorer to show the home folder. + This script starts the File Explorer and shows the user's videos folder. .EXAMPLE PS> ./open-videos-folder .NOTES