From 62d729c359e6566738af49306032fd2272e2c1a7 Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Sat, 23 Oct 2021 16:03:40 +0200 Subject: [PATCH] Add open-music-folder.ps1 --- Data/scripts.csv | 11 ++++++----- README.md | 7 ++++--- Scripts/open-music-folder.ps1 | 24 ++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 8 deletions(-) create mode 100755 Scripts/open-music-folder.ps1 diff --git a/Data/scripts.csv b/Data/scripts.csv index 55f76dbb..c9f22765 100644 --- a/Data/scripts.csv +++ b/Data/scripts.csv @@ -158,14 +158,15 @@ moon.ps1, Prints the current moon phase 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 downloads folder +open-downloads-folder.ps1, Opens the File Explorer with the downloads folder open-email-client.ps1, Starts the default email client -open-file-explorer.ps1, Starts the Microsoft File Explorer -open-home-folder.ps1, Opens the home folder +open-file-explorer.ps1, Opens the File Explorer +open-home-folder.ps1, Opens the File Explorer with the home folder +open-music-folder.ps1, Opens the File Explorer with the music folder open-netflix.ps1, Starts the Netflix app open-onedrive.ps1, Opens the user's OneDrive folder -open-recycle-bin.ps1, Starts the File Explorer with the recycle bin folder -open-repos-folder.ps1, Opens the Git repositories folder +open-recycle-bin.ps1, Opens the File Explorer with the recycle bin folder +open-repos-folder.ps1, Opens the File Explorer with the Git repositories folder open-task-manager.ps1, Starts the Task Manager pick-commit.ps1, Cherry-picks a Git commit into multiple branches play-beep.ps1, Plays a beep sound diff --git a/README.md b/README.md index 9daa9c38..7933bdf0 100644 --- a/README.md +++ b/README.md @@ -115,12 +115,13 @@ Mega Collection of PowerShell Scripts | [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 downloads folder | [Help](Docs/open-downloads-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) | Starts the File Explorer | [Help](Docs/open-file-explorer.md) | -| [open-home-folders.ps1](Scripts/open-home-folder.ps1) | Opens the home folder | [Help](Docs/open-home-folder.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 File Explorer with the home folder | [Help](Docs/open-home-folder.md) | +| [open-music-folder.ps1](Scripts/open-music-folder.ps1)| Opens the File Explorer with the music folder | [Help](Docs/open-music-folder.md) | | [open-netflix.ps1](Scripts/open-netflix.ps1) | Starts the Netflix app | [Help](Docs/open-netflix.md) | | [open-onedrive.ps1](Scripts/open-onedrive.ps1) | Opens the user's OneDrive folder | [Help](Docs/open-onedrive.md) | | [open-recycle-bin.ps1](Scripts/open-recycle-bin.ps1) | Starts the File Explorer with the recycle bin folder | [Help](Docs/open-recycle-bin.md) | -| [open-repos-folders.ps1](Scripts/open-repos-folder.ps1) | Opens the Git repositories folder | [Help](Docs/open-repos-folder.md) | +| [open-repos-folder.ps1](Scripts/open-repos-folder.ps1) | Opens the Git repositories folder | [Help](Docs/open-repos-folder.md) | | [open-task-manager.ps1](Scripts/open-task-manager.ps1)| Starts the Task Manager | [Help](Docs/open-task-manager.md) | | [remind-me.ps1](Scripts/remind-me.ps1) | Creates a scheduled task that will display a popup message | [Help](Docs/remind-me.md) | | [save-screenshot.ps1](Scripts/save-screenshot.ps1) | Saves a single screenshot | [Help](Docs/save-screenshot.md) | diff --git a/Scripts/open-music-folder.ps1 b/Scripts/open-music-folder.ps1 new file mode 100755 index 00000000..fdcd4ebe --- /dev/null +++ b/Scripts/open-music-folder.ps1 @@ -0,0 +1,24 @@ +<# +.SYNOPSIS + Opens the music folder +.DESCRIPTION + This script starts the File Explorer to show the music folder. +.EXAMPLE + PS> ./open-music-folder +.NOTES + Author: Markus Fleschutz · License: CC0 +.LINK + https://github.com/fleschutz/PowerShell +#> + +try { + $TargetDir = resolve-path "$HOME/Music" + if (-not(test-path "$TargetDir" -pathType container)) { + throw "Music 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 +}