From 8274022544234b26a026c867047bbadc89dd64ee Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Fri, 29 Oct 2021 13:02:03 +0200 Subject: [PATCH] Add open-mozilla-firefox.ps1 and rename to close-mozilla-firefox.ps1 --- Data/scripts.csv | 2 +- Docs/close-mozilla-firefox.md | 26 ++++++++++++++ Docs/open-google-chrome.md | 35 +++++++++++++++++++ Docs/open-mozilla-firefox.md | 35 +++++++++++++++++++ README.md | 1 - ...-firefox.ps1 => close-mozilla-firefox.ps1} | 2 +- Scripts/open-mozilla-firefox.ps1 | 28 +++++++++++++++ 7 files changed, 126 insertions(+), 3 deletions(-) create mode 100644 Docs/close-mozilla-firefox.md create mode 100644 Docs/open-google-chrome.md create mode 100644 Docs/open-mozilla-firefox.md rename Scripts/{close-firefox.ps1 => close-mozilla-firefox.ps1} (91%) create mode 100755 Scripts/open-mozilla-firefox.ps1 diff --git a/Data/scripts.csv b/Data/scripts.csv index baf09e3f..e978aa78 100644 --- a/Data/scripts.csv +++ b/Data/scripts.csv @@ -44,11 +44,11 @@ clone-repos.ps1, Clones well-known Git repositories close-calculator.ps1, Closes the calculator program gracefully close-cortana.ps1, Closes Cortana gracefully close-file-explorer.ps1, Closes Microsoft File Explorer gracefully -close-firefox.ps1, Closes the Firefox Web browser close-google-chrome.ps1, Closes the Google Chrome Web browser close-program.ps1, Closes the given program gracefully close-microsoft-edge.ps1, Closes the Microsoft Edge Web browser close-microsoft-store.ps1, Closes the Microsoft Store app +close-mozilla-firefox.ps1, Closes the Mozilla Firefox Web browser close-netflix.ps1, Closes the Netflix application gracefully close-onedrive.ps1, Closes Microsoft OneDrive gracefully close-serenade.ps1, Closes the Serenade.ai application gracefully diff --git a/Docs/close-mozilla-firefox.md b/Docs/close-mozilla-firefox.md new file mode 100644 index 00000000..03555e44 --- /dev/null +++ b/Docs/close-mozilla-firefox.md @@ -0,0 +1,26 @@ +## close-mozilla-firefox.ps1 - Closes Mozilla's Firefox Web browser + +This script closes Mozilla's Firefox Web browser gracefully. + +## Parameters +```powershell +close-mozilla-firefox.ps1 [] + +[] + This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, + WarningVariable, OutBuffer, PipelineVariable, and OutVariable. +``` + +## Example +```powershell +PS> ./close-mozilla-firefox + +``` + +## Notes +Author: Markus Fleschutz · License: CC0 + +## Related Links +https://github.com/fleschutz/PowerShell + +*Generated by convert-ps2md.ps1 using the comment-based help of close-mozilla-firefox.ps1* diff --git a/Docs/open-google-chrome.md b/Docs/open-google-chrome.md new file mode 100644 index 00000000..221d6ad8 --- /dev/null +++ b/Docs/open-google-chrome.md @@ -0,0 +1,35 @@ +## open-google-chrome.ps1 - Launches the Google Chrome Web browser + +This script launches the Google Chrome Web browser. + +## Parameters +```powershell +open-google-chrome.ps1 [[-URL] ] [] + +-URL + Specifies an optional URL + + Required? false + Position? 1 + Default value + Accept pipeline input? false + Accept wildcard characters? false + +[] + This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, + WarningVariable, OutBuffer, PipelineVariable, and OutVariable. +``` + +## Example +```powershell +PS> ./open-google-chrome + +``` + +## 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-google-chrome.ps1* diff --git a/Docs/open-mozilla-firefox.md b/Docs/open-mozilla-firefox.md new file mode 100644 index 00000000..998fe61b --- /dev/null +++ b/Docs/open-mozilla-firefox.md @@ -0,0 +1,35 @@ +## open-mozilla-firefox.ps1 - Launches the Mozilla Firefox Web browser + +This script launches the Mozilla Firefox Web browser. + +## Parameters +```powershell +open-mozilla-firefox.ps1 [[-URL] ] [] + +-URL + Specifies an optional URL + + Required? false + Position? 1 + Default value + Accept pipeline input? false + Accept wildcard characters? false + +[] + This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, + WarningVariable, OutBuffer, PipelineVariable, and OutVariable. +``` + +## Example +```powershell +PS> ./open-mozilla-firefox + +``` + +## 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-mozilla-firefox.ps1* diff --git a/README.md b/README.md index b6d429cb..c61d0ea2 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,6 @@ Mega Collection of PowerShell Scripts | [close-calculator.ps1](Scripts/close-calculator.ps1) | Closes the calculator application | [Help](Docs/close-calculator.md) | | [close-cortana.ps1](Scripts/close-cortana.ps1) | Closes Cortana | [Help](Docs/close-cortana.md) | | [close-file-explorer.ps1](Scripts/close-file-explorer.ps1) | Closes Microsoft File Explorer | [Help](Docs/close-file-explorer.md) | -| [close-firefox.ps1](Scripts/close-firefox.ps1) | Closes the Firefox Web browser | [Help](Docs/close-firefox.md) | | [close-google-chrome.ps1](Scripts/close-google-chrome.ps1)| Closes the Google Chrome Web browser | [Help](Docs/close-google-chrome.md) | | [close-program.ps1](Scripts/close-program.ps1) | Closes the given program gracefully | [Help](Docs/close-program.md) | | [close-microsoft-edge.ps1](Scripts/close-microsoft-edge.ps1)| Closes the Microsoft Edge Web browser | [Help](Docs/close-microsoft-edge.md) | diff --git a/Scripts/close-firefox.ps1 b/Scripts/close-mozilla-firefox.ps1 similarity index 91% rename from Scripts/close-firefox.ps1 rename to Scripts/close-mozilla-firefox.ps1 index 6a0f696a..c784b65e 100755 --- a/Scripts/close-firefox.ps1 +++ b/Scripts/close-mozilla-firefox.ps1 @@ -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 diff --git a/Scripts/open-mozilla-firefox.ps1 b/Scripts/open-mozilla-firefox.ps1 new file mode 100755 index 00000000..22ad5ecd --- /dev/null +++ b/Scripts/open-mozilla-firefox.ps1 @@ -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 +}