mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-22 16:03:22 +01:00
Updated open-URL.ps1
This commit is contained in:
parent
db12f45e0f
commit
3591f7c584
@ -39836,7 +39836,7 @@ LFPC,Creil Air Base (France)
|
|||||||
LFPD,Aérodrome de Bernay-Saint-Martin (France)
|
LFPD,Aérodrome de Bernay-Saint-Martin (France)
|
||||||
LFPE,Aérodrome de Meaux-Esbly (France)
|
LFPE,Aérodrome de Meaux-Esbly (France)
|
||||||
LFPF,Aérodrome de Beynes - Thiverval (France)
|
LFPF,Aérodrome de Beynes - Thiverval (France)
|
||||||
LFPG,Charles de Gaulle International Airport (France)
|
LFPG,Charles de Gaulle International Airport (Paris, France)
|
||||||
LFPH,Aérodrome de Chelles-le-Pin (France)
|
LFPH,Aérodrome de Chelles-le-Pin (France)
|
||||||
LFPI,Paris Issy-les-Moulineaux Heliport (France)
|
LFPI,Paris Issy-les-Moulineaux Heliport (France)
|
||||||
LFPK,Aérodrome de Coulommiers - Voisins (France)
|
LFPK,Aérodrome de Coulommiers - Voisins (France)
|
||||||
|
Can't render this file because it is too large.
|
@ -1,24 +1,25 @@
|
|||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Opens the default browser
|
Opens an URL in the default browser
|
||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
This PowerShell script launches the default Web browser, optional with a given URL.
|
This PowerShell script launches a new tab in the default Web browser with the given URL.
|
||||||
.PARAMETER URL
|
.PARAMETER URL
|
||||||
Specifies the URL
|
Specifies the URL
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
PS> ./open-default-browser
|
PS> ./open-URL.ps1 https://cnn.com
|
||||||
.LINK
|
.LINK
|
||||||
https://github.com/fleschutz/PowerShell
|
https://github.com/fleschutz/PowerShell
|
||||||
.NOTES
|
.NOTES
|
||||||
Author: Markus Fleschutz | License: CC0
|
Author: Markus Fleschutz | License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
param([string]$URL = "http://www.fleschutz.de")
|
param([string]$URL = "")
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
if ($URL -eq "") { $URL = Read-Host "Enter the URL" }
|
||||||
Start-Process $URL
|
Start-Process $URL
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
"⚠️ Error: $($Error[0]) (script line $($_.InvocationInfo.ScriptLineNumber))"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user