diff --git a/Scripts/open-dashboards.ps1 b/Scripts/open-dashboards.ps1 index 674f3f79..da4422de 100644 --- a/Scripts/open-dashboards.ps1 +++ b/Scripts/open-dashboards.ps1 @@ -11,12 +11,21 @@ Author: Markus Fleschutz | License: CC0 #> -& "$PSScriptRoot/open-default-browser.ps1" https://track.toggl.com/timer -& "$PSScriptRoot/open-default-browser.ps1" https://news.google.com -& "$PSScriptRoot/open-default-browser.ps1" https://www.windy.com/de/-Wetterradar-radar -& "$PSScriptRoot/open-default-browser.ps1" https://www.arcgis.com/apps/dashboards/c8af9c5411814584b460cc87cb7c3780 -& "$PSScriptRoot/open-default-browser.ps1" https://radio.garden/visit/kempten/V5Ryr1S4 -& "$PSScriptRoot/open-default-browser.ps1" https://www.foto-webcam.eu/ -& "$PSScriptRoot/open-default-browser.ps1" https://sunnyportal.com/FixedPages/Dashboard.aspx -& "$PSScriptRoot/open-default-browser.ps1" https://covid19.who.int/ -exit 0 # success +try { + $stopWatch = [system.diagnostics.stopwatch]::startNew() + & "$PSScriptRoot/open-default-browser.ps1" https://track.toggl.com/timer + & "$PSScriptRoot/open-default-browser.ps1" https://news.google.com + & "$PSScriptRoot/open-default-browser.ps1" https://www.windy.com/de/-Wetterradar-radar + & "$PSScriptRoot/open-default-browser.ps1" https://www.arcgis.com/apps/dashboards/c8af9c5411814584b460cc87cb7c3780 + & "$PSScriptRoot/open-default-browser.ps1" https://radio.garden/visit/kempten/V5Ryr1S4 + & "$PSScriptRoot/open-default-browser.ps1" https://www.foto-webcam.eu/ + & "$PSScriptRoot/open-default-browser.ps1" https://sunnyportal.com/FixedPages/Dashboard.aspx + & "$PSScriptRoot/open-default-browser.ps1" https://covid19.who.int/ + & "$PSScriptRoot/open-default-browser.ps1" https://top10.netflix.com/ + [int]$elapsed = $stopWatch.Elapsed.TotalSeconds + "✅ Opened 9 dashboards as browser tabs in $elapsed sec (use switch-tabs.ps1 to switch the tabs automatically)" + exit 0 # success +} catch { + "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" + exit 1 +} diff --git a/Scripts/switch-tabs.ps1 b/Scripts/switch-tabs.ps1 index a33f353b..4b9fe240 100644 --- a/Scripts/switch-tabs.ps1 +++ b/Scripts/switch-tabs.ps1 @@ -1,4 +1,4 @@ -<# +<# .SYNOPSIS Switches browser tabs .DESCRIPTION @@ -14,11 +14,10 @@ param([int]$Interval = 5) # in seconds try { - Write-Host "Switching browser tabs automatically every $Interval seconds." - Write-Host "Click into the browser window to activate it (press Ctrl + C here to stop it)..." -noNewline + Write-Host "✅ Switching browser tabs automatically every $Interval seconds..." + Write-Host " (click into the browser window to activate it, press Ctrl + C here to stop it)" $obj = New-Object -com wscript.shell for ([int]$i = 0; $i -lt 1000; $i++) { - Write-Host "." -noNewline $obj.SendKeys("^{PGDN}") Start-Sleep -seconds $Interval }