PowerShell/docs/open-dashboards.md

88 lines
2.4 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-03-27 17:36:59 +01:00
PS> ./open-dashboards.ps1 [[-interval] <Int32>] [<CommonParameters>]
-interval <Int32>
Specifies the time interval (110ms per default)
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-03-27 17:36:59 +01:00
✅ Launching Web browser with 20 tabs showing: Toggl Track, Google Calendar, Google Mail, ...
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-03-27 17:36:59 +01:00
.PARAMETER interval
Specifies the time interval (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-03-27 17:36:59 +01:00
✅ Launching Web browser with 20 tabs showing: Toggl Track, Google Calendar, Google Mail, ...
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-03-27 17:36:59 +01:00
param([int]$interval = 110) # milliseconds
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"
2023-07-29 09:45:37 +02:00
$numRows = $table.Length
2024-03-27 17:36:59 +01:00
Write-Progress -completed "Done."
2023-09-01 17:53:03 +02:00
Write-Host "✅ Launching Web browser with 20 tabs showing: " -noNewline
2023-07-29 09:45:37 +02:00
foreach($row in $table) {
2023-09-01 17:53:03 +02:00
Write-Host "$($row.NAME), " -noNewline
2023-07-29 09:45:37 +02:00
& "$PSScriptRoot/open-default-browser.ps1" "$($row.URL)"
2024-03-27 17:36:59 +01:00
Start-Sleep -milliseconds $interval
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-03-27 17:36:59 +01:00
*(generated by convert-ps2md.ps1 using the comment-based help of open-dashboards.ps1 as of 03/27/2024 17:36:29)*