Rename to open-downloads-folder.ps1

This commit is contained in:
Markus Fleschutz
2021-10-23 11:00:38 +02:00
parent 77fc5ad500
commit d4c81b01aa
4 changed files with 10 additions and 6 deletions

View File

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