mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-09 05:04:39 +02:00
Updated the manuals
This commit is contained in:
@ -1,15 +1,15 @@
|
||||
Script: *switch-tabs.ps1*
|
||||
========================
|
||||
|
||||
This PowerShell script switches browser tabs automatically every <n> seconds (by pressing Ctrl + PageDown).
|
||||
This PowerShell script switches automatically from tab to tab every <n> seconds (by pressing Ctrl + PageDown).
|
||||
|
||||
Parameters
|
||||
----------
|
||||
```powershell
|
||||
PS> ./switch-tabs.ps1 [[-Interval] <Int32>] [<CommonParameters>]
|
||||
PS> ./switch-tabs.ps1 [[-timeInterval] <Int32>] [<CommonParameters>]
|
||||
|
||||
-Interval <Int32>
|
||||
Specifies the switch interval in seconds (10 sec per default)
|
||||
-timeInterval <Int32>
|
||||
Specifies the time interval in seconds (10sec per default)
|
||||
|
||||
Required? false
|
||||
Position? 1
|
||||
@ -25,7 +25,9 @@ PS> ./switch-tabs.ps1 [[-Interval] <Int32>] [<CommonParameters>]
|
||||
Example
|
||||
-------
|
||||
```powershell
|
||||
PS> ./switch-tabs
|
||||
PS> ./switch-tabs.ps1
|
||||
⏳ Switching from tab to tab automatically every 10 seconds...
|
||||
(click the Web browser to activate it - press <Ctrl C> here to stop it)
|
||||
|
||||
```
|
||||
|
||||
@ -35,35 +37,37 @@ Author: Markus Fleschutz / License: CC0
|
||||
|
||||
Related Links
|
||||
-------------
|
||||
https://github.com/fleschutz/talk2windows
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
Script Content
|
||||
--------------
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Switches browser tabs
|
||||
Switches Web browser tabs
|
||||
.DESCRIPTION
|
||||
This PowerShell script switches browser tabs automatically every <n> seconds (by pressing Ctrl + PageDown).
|
||||
.PARAMETER Interval
|
||||
Specifies the switch interval in seconds (10 sec per default)
|
||||
This PowerShell script switches automatically from tab to tab every <n> seconds (by pressing Ctrl + PageDown).
|
||||
.PARAMETER timeInterval
|
||||
Specifies the time interval in seconds (10sec per default)
|
||||
.EXAMPLE
|
||||
PS> ./switch-tabs
|
||||
PS> ./switch-tabs.ps1
|
||||
⏳ Switching from tab to tab automatically every 10 seconds...
|
||||
(click the Web browser to activate it - press <Ctrl C> here to stop it)
|
||||
.NOTES
|
||||
Author: Markus Fleschutz / License: CC0
|
||||
.LINK
|
||||
https://github.com/fleschutz/talk2windows
|
||||
https://github.com/fleschutz/PowerShell
|
||||
#>
|
||||
|
||||
param([int]$Interval = 10) # in seconds
|
||||
param([int]$timeInterval = 10) # 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)"
|
||||
Write-Host "⏳ Switching from tab to tab automatically every $timeInterval seconds..."
|
||||
Write-Host " (click the Web browser to activate it - press <Ctrl C> here to stop it)"
|
||||
$obj = New-Object -com wscript.shell
|
||||
while ($true) {
|
||||
$obj.SendKeys("^{PGDN}")
|
||||
Start-Sleep -seconds $Interval
|
||||
Start-Sleep -seconds $timeInterval
|
||||
}
|
||||
exit 0 # success
|
||||
} catch {
|
||||
@ -72,4 +76,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of switch-tabs.ps1 as of 01/25/2024 13:58:42)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of switch-tabs.ps1 as of 03/27/2024 17:36:32)*
|
||||
|
Reference in New Issue
Block a user