mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-03-31 19:26:27 +02:00
Add open-pictures-folder.ps1
This commit is contained in:
parent
ba17c231db
commit
94352bf11b
26
Docs/open-pictures-folder.md
Normal file
26
Docs/open-pictures-folder.md
Normal file
@ -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 [<CommonParameters>]
|
||||||
|
|
||||||
|
[<CommonParameters>]
|
||||||
|
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*
|
@ -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-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-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-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-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-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) |
|
| [open-snipping-tool.ps1](Scripts/open-snipping-tool.ps1)| Starts the Snipping Tool | [Help](Docs/open-snipping-tool.md) |
|
||||||
|
24
Scripts/open-pictures-folder.ps1
Executable file
24
Scripts/open-pictures-folder.ps1
Executable file
@ -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
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user