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

@ -158,7 +158,7 @@ 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.ps1, Opens the downloads folder
open-downloads-folder.ps1, Opens the downloads folder
open-email-client.ps1, Starts the default email client
open-file-explorer.ps1, Starts the Microsoft File Explorer
open-netflix.ps1, Starts the Netflix app

Can't render this file because it has a wrong number of fields in line 91.

View File

@ -113,7 +113,7 @@ Mega Collection of PowerShell Scripts
| [new-email.ps1](Scripts/new-email.ps1) | Starts the default email client to write a new email | [Help](Docs/new-email.md) |
| [open-browser.ps1](Scripts/open-browser.ps1) | Starts the default Web browser | [Help](Docs/open-browser.md) |
| [open-calculator.ps1](Scripts/open-calculator.ps1) | Starts the calculator program | [Help](Docs/open-calculator.md) |
| [open-downloads.ps1](Scripts/open-downloads.ps1) | Opens the downloads folder | [Help](Docs/open-downloads.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-netflix.ps1](Scripts/open-netflix.ps1) | Starts the Netflix app | [Help](Docs/open-netflix.md) |

View File

@ -2,9 +2,9 @@
.SYNOPSIS
Opens the downloads folder
.DESCRIPTION
This script starts the File Explorer with the downloads folder.
This script starts the File Explorer to show the downloads folder.
.EXAMPLE
PS> ./open-file-explorer
PS> ./open-downloads-folder
.NOTES
Author: Markus Fleschutz · License: CC0
.LINK
@ -16,7 +16,7 @@ try {
if (-not(test-path "$TargetDir" -pathType container)) {
throw "Downloads folder at 📂$TargetDir doesn't exist (yet)"
}
start-process explorer.exe "$TargetDir"
"$PSScriptRoot/open-file-explorer.ps1" "$TargetDir"
exit 0 # success
} catch {
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"

View File

@ -5,14 +5,18 @@
This script starts the File Explorer.
.EXAMPLE
PS> ./open-file-explorer
.PARAMETER Path
Specifies the path to the folder to display
.NOTES
Author: Markus Fleschutz · License: CC0
.LINK
https://github.com/fleschutz/PowerShell
#>
param([string]$Path = "")
try {
start-process explorer.exe
start-process explorer.exe "$Path"
exit 0 # success
} catch {
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"