mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-05-06 08:34:49 +02:00
Update open-dashboards.ps1 and switch-tabs.ps1
This commit is contained in:
parent
7795237e60
commit
a03fd7210f
@ -11,6 +11,8 @@
|
|||||||
Author: Markus Fleschutz | License: CC0
|
Author: Markus Fleschutz | License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
|
try {
|
||||||
|
$stopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||||
& "$PSScriptRoot/open-default-browser.ps1" https://track.toggl.com/timer
|
& "$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://news.google.com
|
||||||
& "$PSScriptRoot/open-default-browser.ps1" https://www.windy.com/de/-Wetterradar-radar
|
& "$PSScriptRoot/open-default-browser.ps1" https://www.windy.com/de/-Wetterradar-radar
|
||||||
@ -19,4 +21,11 @@
|
|||||||
& "$PSScriptRoot/open-default-browser.ps1" https://www.foto-webcam.eu/
|
& "$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://sunnyportal.com/FixedPages/Dashboard.aspx
|
||||||
& "$PSScriptRoot/open-default-browser.ps1" https://covid19.who.int/
|
& "$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
|
exit 0 # success
|
||||||
|
} catch {
|
||||||
|
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Switches browser tabs
|
Switches browser tabs
|
||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
@ -14,11 +14,10 @@
|
|||||||
param([int]$Interval = 5) # in seconds
|
param([int]$Interval = 5) # in seconds
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Write-Host "Switching browser tabs automatically every $Interval seconds."
|
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 " (click into the browser window to activate it, press Ctrl + C here to stop it)"
|
||||||
$obj = New-Object -com wscript.shell
|
$obj = New-Object -com wscript.shell
|
||||||
for ([int]$i = 0; $i -lt 1000; $i++) {
|
for ([int]$i = 0; $i -lt 1000; $i++) {
|
||||||
Write-Host "." -noNewline
|
|
||||||
$obj.SendKeys("^{PGDN}")
|
$obj.SendKeys("^{PGDN}")
|
||||||
Start-Sleep -seconds $Interval
|
Start-Sleep -seconds $Interval
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user