PowerShell/docs/open-dashboards.md

88 lines
2.5 KiB
Markdown
Raw Normal View History

2024-01-25 13:37:12 +01:00
Script: *open-dashboards.ps1*
========================
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-05-19 10:25:56 +02:00
PS> ./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
Default value 110
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-05-19 10:25:56 +02:00
✅ Launching Web browser with 20 tabs showing 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
2023-07-29 09:45:37 +02:00
Open 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-05-19 10:25:56 +02:00
✅ Launching Web browser with 20 tabs showing 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-05-19 10:25:56 +02:00
param([int]$timeInterval = 110) # 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-05-19 10:25:56 +02:00
Write-Host "✅ Launching Web browser with 20 tabs showing " -noNewline
$numRows = $table.Length
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-05-19 10:25:56 +02:00
*(generated by convert-ps2md.ps1 using the comment-based help of open-dashboards.ps1 as of 05/19/2024 10:25:23)*