2024-11-08 12:38:20 +01:00
|
|
|
The *open-dashboards.ps1* Script
|
|
|
|
===========================
|
2023-05-26 12:20:18 +02:00
|
|
|
|
2023-09-01 17:53:03 +02:00
|
|
|
This PowerShell script launches the Web browser with 20 tabs of popular dashboard websites.
|
2023-05-26 12:20:18 +02:00
|
|
|
|
2023-07-29 10:04:38 +02:00
|
|
|
Parameters
|
|
|
|
----------
|
2023-05-26 12:20:18 +02:00
|
|
|
```powershell
|
2024-11-08 12:35:11 +01:00
|
|
|
/home/markus/Repos/PowerShell/scripts/open-dashboards.ps1 [[-timeInterval] <Int32>] [<CommonParameters>]
|
2024-03-27 17:36:59 +01:00
|
|
|
|
2024-05-19 10:25:56 +02:00
|
|
|
-timeInterval <Int32>
|
|
|
|
Specifies the time interval between each tab (110ms per default)
|
2024-03-27 17:36:59 +01:00
|
|
|
|
|
|
|
Required? false
|
|
|
|
Position? 1
|
2024-11-08 12:35:11 +01:00
|
|
|
Default value 120
|
2024-03-27 17:36:59 +01:00
|
|
|
Accept pipeline input? false
|
|
|
|
Accept wildcard characters? false
|
2023-05-26 12:20:18 +02:00
|
|
|
|
|
|
|
[<CommonParameters>]
|
|
|
|
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
|
|
|
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
|
|
|
```
|
|
|
|
|
2023-07-29 10:04:38 +02:00
|
|
|
Example
|
|
|
|
-------
|
2023-05-26 12:20:18 +02:00
|
|
|
```powershell
|
2023-07-29 09:45:37 +02:00
|
|
|
PS> ./open-dashboards.ps1
|
2024-11-08 12:35:11 +01:00
|
|
|
✅ Launching Web browser with 20 tabs: Toggl Track•Google Calendar•Google Mail, ...
|
2024-03-27 17:36:59 +01:00
|
|
|
NOTE: Execute './switch-tabs.ps1' to switch from tab to tab automatically.
|
2023-07-29 09:45:37 +02:00
|
|
|
...
|
2023-05-26 12:20:18 +02:00
|
|
|
|
|
|
|
```
|
|
|
|
|
2023-07-29 10:04:38 +02:00
|
|
|
Notes
|
|
|
|
-----
|
2023-05-26 12:20:18 +02:00
|
|
|
Author: Markus Fleschutz | License: CC0
|
|
|
|
|
2023-07-29 10:04:38 +02:00
|
|
|
Related Links
|
|
|
|
-------------
|
2023-05-26 12:20:18 +02:00
|
|
|
https://github.com/fleschutz/PowerShell
|
|
|
|
|
2023-07-29 10:04:38 +02:00
|
|
|
Script Content
|
|
|
|
--------------
|
2023-05-26 12:20:18 +02:00
|
|
|
```powershell
|
|
|
|
<#
|
|
|
|
.SYNOPSIS
|
2024-11-08 12:35:11 +01:00
|
|
|
Open 20 web dashboards
|
2023-05-26 12:20:18 +02:00
|
|
|
.DESCRIPTION
|
2023-09-01 17:53:03 +02:00
|
|
|
This PowerShell script launches the Web browser with 20 tabs of popular dashboard websites.
|
2024-05-19 10:25:56 +02:00
|
|
|
.PARAMETER timeInterval
|
|
|
|
Specifies the time interval between each tab (110ms per default)
|
2023-05-26 12:20:18 +02:00
|
|
|
.EXAMPLE
|
2023-07-29 09:45:37 +02:00
|
|
|
PS> ./open-dashboards.ps1
|
2024-11-08 12:35:11 +01:00
|
|
|
✅ Launching Web browser with 20 tabs: Toggl Track•Google Calendar•Google Mail, ...
|
2024-03-27 17:36:59 +01:00
|
|
|
NOTE: Execute './switch-tabs.ps1' to switch from tab to tab automatically.
|
2023-07-29 09:45:37 +02:00
|
|
|
...
|
2023-05-26 12:20:18 +02:00
|
|
|
.LINK
|
|
|
|
https://github.com/fleschutz/PowerShell
|
|
|
|
.NOTES
|
|
|
|
Author: Markus Fleschutz | License: CC0
|
|
|
|
#>
|
|
|
|
|
2024-11-08 12:35:11 +01:00
|
|
|
param([int]$timeInterval = 120) # milliseconds
|
2024-03-27 17:36:59 +01:00
|
|
|
|
2023-05-26 12:20:18 +02:00
|
|
|
try {
|
2023-12-07 20:24:45 +01:00
|
|
|
Write-Progress "Reading Data/popular-dashboards.csv..."
|
|
|
|
$table = Import-CSV "$PSScriptRoot/../data/popular-dashboards.csv"
|
2024-03-27 17:36:59 +01:00
|
|
|
Write-Progress -completed "Done."
|
|
|
|
|
2024-11-08 12:35:11 +01:00
|
|
|
Write-Host "✅ Launching Web browser with 20 tabs: " -noNewline
|
2023-07-29 09:45:37 +02:00
|
|
|
foreach($row in $table) {
|
2024-05-19 10:25:56 +02:00
|
|
|
Write-Host "$($row.NAME)•" -noNewline
|
2023-07-29 09:45:37 +02:00
|
|
|
& "$PSScriptRoot/open-default-browser.ps1" "$($row.URL)"
|
2024-05-19 10:25:56 +02:00
|
|
|
Start-Sleep -milliseconds $timeInterval
|
2023-05-26 12:20:18 +02:00
|
|
|
}
|
2024-03-27 17:36:59 +01:00
|
|
|
Write-Host ""
|
|
|
|
Write-Host "NOTE: Execute './switch-tabs.ps1' to switch from tab to tab automatically."
|
2023-05-26 12:20:18 +02:00
|
|
|
exit 0 # success
|
|
|
|
} catch {
|
|
|
|
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2024-11-08 12:40:31 +01:00
|
|
|
*(generated by convert-ps2md.ps1 as of 11/08/2024 12:40:20)*
|