Update open-dashboards.ps1 and switch-tabs.ps1

This commit is contained in:
Markus Fleschutz 2023-03-20 07:57:12 +01:00
parent a778fa2c58
commit 90e5fc9398
2 changed files with 7 additions and 5 deletions

View File

@ -11,6 +11,7 @@
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

View File

@ -1,12 +1,12 @@
<#
.SYNOPSIS
Presses the Next Tab hotkey
Switches browser tabs
.DESCRIPTION
This PowerShell script presses the Next Tab keyboard shortcuts.
This PowerShell script switches browser tabs automatically every <n> seconds (by pressing Ctrl + PageDown).
.EXAMPLE
PS> ./switch-tabs
.NOTES
Author: Markus Fleschutz / License: CC0
Author: Markus Fleschutz / License: CC0
.LINK
https://github.com/fleschutz/talk2windows
#>
@ -14,7 +14,8 @@
param([int]$Interval = 5) # in seconds
try {
Write-Host "Switching browser tabs every $Interval seconds (press Ctrl + C 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)..." -noNewline
$obj = New-Object -com wscript.shell
for ([int]$i = 0; $i -lt 1000; $i++) {
Write-Host "." -noNewline
@ -23,6 +24,6 @@ try {
}
exit 0 # success
} catch {
& "$PSScriptRoot/_reply.ps1" "Sorry: $($Error[0])"
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}