From a5d61a40b0d9a6e1196dd2a307136d4a2066fcd4 Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Fri, 29 Oct 2021 12:56:26 +0200 Subject: [PATCH] Add open-google-chrome.ps1 --- Scripts/open-google-chrome.ps1 | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 Scripts/open-google-chrome.ps1 diff --git a/Scripts/open-google-chrome.ps1 b/Scripts/open-google-chrome.ps1 new file mode 100755 index 00000000..6d394553 --- /dev/null +++ b/Scripts/open-google-chrome.ps1 @@ -0,0 +1,28 @@ +<# +.SYNOPSIS + Launches the Google Chrome Web browser +.DESCRIPTION + This script launches the Google Chrome Web browser. +.EXAMPLE + PS> ./open-google-chrome +.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 chrome.exe "$URL" + } else { + start-process chrome.exe + } + exit 0 # success +} catch { + "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))" + exit 1 +}