Add open-mozilla-firefox.ps1 and rename to close-mozilla-firefox.ps1

This commit is contained in:
Markus Fleschutz
2021-10-29 13:02:03 +02:00
parent a5d61a40b0
commit 8274022544
7 changed files with 126 additions and 3 deletions

View File

@ -4,7 +4,7 @@
.DESCRIPTION
This script closes Mozilla's Firefox Web browser gracefully.
.EXAMPLE
PS> ./close-firefox
PS> ./close-mozilla-firefox
.NOTES
Author: Markus Fleschutz · License: CC0
.LINK

View File

@ -0,0 +1,28 @@
<#
.SYNOPSIS
Launches the Mozilla Firefox Web browser
.DESCRIPTION
This script launches the Mozilla Firefox Web browser.
.EXAMPLE
PS> ./open-mozilla-firefox
.PARAMETER URL
Specifies an optional URL
.NOTES
Author: Markus Fleschutz · License: CC0
.LINK
https://github.com/fleschutz/PowerShell
#>
param([string]$URL = "")
try {
if ("$URL" -ne "") {
start-process firefox.exe "$URL"
} else {
start-process firefox.exe
}
exit 0 # success
} catch {
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1
}