Add open-videos-folder.ps1

This commit is contained in:
Markus Fleschutz
2021-10-23 16:12:37 +02:00
parent 62d729c359
commit 6ed1e06438
7 changed files with 117 additions and 13 deletions

24
Scripts/open-videos-folders.ps1 Executable file
View File

@ -0,0 +1,24 @@
<#
.SYNOPSIS
Opens the File Explorer with the videos folder
.DESCRIPTION
This script starts the File Explorer to show the home folder.
.EXAMPLE
PS> ./open-videos-folder
.NOTES
Author: Markus Fleschutz · License: CC0
.LINK
https://github.com/fleschutz/PowerShell
#>
try {
$TargetDir = resolve-path "$HOME/Videos"
if (-not(test-path "$TargetDir" -pathType container)) {
throw "Videos 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
}