diff --git a/Docs/open-pictures-folder.md b/Docs/open-pictures-folder.md new file mode 100644 index 00000000..4cb38cd7 --- /dev/null +++ b/Docs/open-pictures-folder.md @@ -0,0 +1,26 @@ +## open-pictures-folder.ps1 - Opens the user's pictures folder + +This script starts the File Explorer and shows the user's pictures folder. + +## Parameters +```powershell +open-pictures-folder.ps1 [] + +[] + This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, + WarningVariable, OutBuffer, PipelineVariable, and OutVariable. +``` + +## Example +```powershell +PS> ./open-pictures-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-pictures-folder.ps1* diff --git a/README.md b/README.md index 140f5b89..a48b00ab 100644 --- a/README.md +++ b/README.md @@ -124,6 +124,7 @@ Mega Collection of PowerShell Scripts | [open-netflix.ps1](Scripts/open-netflix.ps1) | Starts the Netflix app | [Help](Docs/open-netflix.md) | | [open-notepad.ps1](Scripts/open-notepad.ps1) | Starts the Notepad app | [Help](Docs/open-notepad.md) | | [open-onedrive-folder.ps1](Scripts/open-onedrive-folder.ps1)| Opens the user's OneDrive folder | [Help](Docs/open-onedrive-folder.md) | +| [open-pictures-folder.ps1](Scripts/open-pictures-folder.ps1) | Opens the user's pictures folder | [Help](Docs/open-pictures-folder.md) | | [open-recycle-bin.ps1](Scripts/open-recycle-bin.ps1) | Opens the user's recycle bin folder | [Help](Docs/open-recycle-bin.md) | | [open-repos-folder.ps1](Scripts/open-repos-folder.ps1) | Opens the user's Git repositories folder | [Help](Docs/open-repos-folder.md) | | [open-snipping-tool.ps1](Scripts/open-snipping-tool.ps1)| Starts the Snipping Tool | [Help](Docs/open-snipping-tool.md) | diff --git a/Scripts/open-pictures-folder.ps1 b/Scripts/open-pictures-folder.ps1 new file mode 100755 index 00000000..c94c4199 --- /dev/null +++ b/Scripts/open-pictures-folder.ps1 @@ -0,0 +1,24 @@ +<# +.SYNOPSIS + Opens the user's pictures folder +.DESCRIPTION + This script starts the File Explorer and shows the user's pictures folder. +.EXAMPLE + PS> ./open-pictures-folder +.NOTES + Author: Markus Fleschutz · License: CC0 +.LINK + https://github.com/fleschutz/PowerShell +#> + +try { + $TargetDir = resolve-path "$HOME/Pictures" + if (-not(test-path "$TargetDir" -pathType container)) { + throw "Pictures 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 +}