mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-05-06 00:24:53 +02:00
Added open-URL.ps1
This commit is contained in:
parent
b3630a67c0
commit
e447641434
24
scripts/open-URL.ps1
Normal file
24
scripts/open-URL.ps1
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Opens the default browser
|
||||||
|
.DESCRIPTION
|
||||||
|
This PowerShell script launches the default Web browser, optional with a given URL.
|
||||||
|
.PARAMETER URL
|
||||||
|
Specifies the URL
|
||||||
|
.EXAMPLE
|
||||||
|
PS> ./open-default-browser
|
||||||
|
.LINK
|
||||||
|
https://github.com/fleschutz/PowerShell
|
||||||
|
.NOTES
|
||||||
|
Author: Markus Fleschutz | License: CC0
|
||||||
|
#>
|
||||||
|
|
||||||
|
param([string]$URL = "http://www.fleschutz.de")
|
||||||
|
|
||||||
|
try {
|
||||||
|
Start-Process $URL
|
||||||
|
exit 0 # success
|
||||||
|
} catch {
|
||||||
|
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
exit 1
|
||||||
|
}
|
@ -1,12 +1,12 @@
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
& "$PSScriptRoot/open-default-browser.ps1" "https://docs.microsoft.com/en-us/powershell"
|
& "$PSScriptRoot/open-URL.ps1" "https://docs.microsoft.com/en-us/powershell"
|
||||||
Start-Sleep -milliseconds 100
|
Start-Sleep -milliseconds 100
|
||||||
& "$PSScriptRoot/open-default-browser.ps1" "https://github.com/fleschutz/PowerShell/blob/main/docs/FAQ.md"
|
& "$PSScriptRoot/open-URL.ps1" "https://github.com/fleschutz/PowerShell/blob/main/docs/FAQ.md"
|
||||||
Start-Sleep -milliseconds 100
|
Start-Sleep -milliseconds 100
|
||||||
& "$PSScriptRoot/open-default-browser.ps1" "https://github.com/fleschutz/PowerShell/blob/main/docs/cheat-sheet.md"
|
& "$PSScriptRoot/open-URL.ps1" "https://github.com/fleschutz/PowerShell/blob/main/docs/cheat-sheet.md"
|
||||||
|
|
||||||
& "$PSScriptRoot/write-typewriter.ps1" "DON'T PANIC and check your brower tabs..."
|
& "$PSScriptRoot/write-typewriter.ps1" "DON'T PANIC and check the new brower tabs..."
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
Loading…
Reference in New Issue
Block a user