The *switch-tabs.ps1* Script =========================== This PowerShell script switches automatically from tab to tab every seconds (by pressing Ctrl + PageDown). Parameters ---------- ```powershell /home/markus/Repos/PowerShell/scripts/switch-tabs.ps1 [[-timeInterval] ] [] -timeInterval Specifies the time interval in seconds (10sec per default) Required? false Position? 1 Default value 10 Accept pipeline input? false Accept wildcard characters? false [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. ``` Example ------- ```powershell PS> ./switch-tabs.ps1 ⏳ Switching from tab to tab automatically every 10 seconds... (click the Web browser to activate it - press here to stop it) ``` Notes ----- Author: Markus Fleschutz / License: CC0 Related Links ------------- https://github.com/fleschutz/PowerShell Script Content -------------- ```powershell <# .SYNOPSIS Switches Web browser tabs .DESCRIPTION This PowerShell script switches automatically from tab to tab every seconds (by pressing Ctrl + PageDown). .PARAMETER timeInterval Specifies the time interval in seconds (10sec per default) .EXAMPLE PS> ./switch-tabs.ps1 ⏳ Switching from tab to tab automatically every 10 seconds... (click the Web browser to activate it - press here to stop it) .NOTES Author: Markus Fleschutz / License: CC0 .LINK https://github.com/fleschutz/PowerShell #> param([int]$timeInterval = 10) # in seconds try { Write-Host "⏳ Switching from tab to tab automatically every $timeInterval seconds..." Write-Host " (click the Web browser to activate it - press here to stop it)" $obj = New-Object -com wscript.shell while ($true) { $obj.SendKeys("^{PGDN}") Start-Sleep -seconds $timeInterval } exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" exit 1 } ``` *(generated by convert-ps2md.ps1 as of 11/20/2024 11:52:01)*