Updated open-dashboards.ps1

This commit is contained in:
Markus Fleschutz
2023-06-22 09:45:11 +02:00
parent 821372c229
commit 091c7a1a3c
2 changed files with 16 additions and 11 deletions

View File

@ -1,12 +1,12 @@
<#
.SYNOPSIS
Open dashboards
Open Web dashboards
.DESCRIPTION
This PowerShell script launches the Web browser with tabs of popular dashboard websites.
.EXAMPLE
PS> ./open-dashboards
⏳ (1/2) Loading Data/popular-dashboards.csv...
⏳ (2/2) Launching Web browser with tabs: Toggl Track · Google Calendar · CNN World News...
PS> ./open-dashboards.ps1
⏳ (1/2) Loading Data/web-dashboards.csv...
⏳ (2/2) Launching Web browser with tabs... Toggl Track · Google Calendar · CNN News...
...
.LINK
https://github.com/fleschutz/PowerShell
@ -16,20 +16,20 @@
try {
$stopWatch = [system.diagnostics.stopwatch]::startNew()
Write-Host "⏳ (1/2) Loading Data/popular-dashboards.csv..."
$table = Import-CSV "$PSScriptRoot/../Data/popular-dashboards.csv"
Write-Host "⏳ (1/2) Loading Data/web-dashboards.csv..."
$table = Import-CSV "$PSScriptRoot/../Data/web-dashboards.csv"
$numRows = $table.Length
Write-Host "⏳ (2/2) Launching Web browser with tabs: " -noNewline
Write-Host "⏳ (2/2) Launching Web browser with tabs... " -noNewline
foreach($row in $table) {
Write-Host "$($row.NAME) · " -noNewline
& "$PSScriptRoot/open-default-browser.ps1" "$($row.URL)"
Start-Sleep -milliseconds 50
Start-Sleep -milliseconds 100
}
Write-Host ""
[int]$elapsed = $stopWatch.Elapsed.TotalSeconds
"Opened $NumRows dashboards in $elapsed sec (Hint: use switch-tabs.ps1 to switch between browser tabs automatically)"
"opened $NumRows Web dashboards in $elapsed sec (Hint: use switch-tabs.ps1 to switch between browser tabs automatically)"
exit 0 # success
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}
}