Skip to content

Commit c056e4e

Browse files
committed
Update open-dashboards.ps1
1 parent 67a8cc6 commit c056e4e

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

Scripts/open-dashboards.ps1

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
.SYNOPSIS
33
Open dashboards
44
.DESCRIPTION
5-
This PowerShell script launches the Web browser with tabs of some dashboard websites.
5+
This PowerShell script launches the Web browser with tabs of popular dashboard websites.
66
.EXAMPLE
77
PS> ./open-dashboards
88
⏳ (1/2) Loading Data/popular-dashboards.csv...
9-
⏳ (2/2) Launching Web browser with tabs of dashboard websites...
9+
⏳ (2/2) Launching Web browser with tabs: Toggl Track · Google Calendar · CNN World News...
1010
...
1111
.LINK
1212
https://github.com/fleschutz/PowerShell
@@ -17,20 +17,17 @@
1717
try {
1818
$stopWatch = [system.diagnostics.stopwatch]::startNew()
1919
Write-Host "⏳ (1/2) Loading Data/popular-dashboards.csv..."
20-
$Table = Import-CSV "$PSScriptRoot/../Data/popular-dashboards.csv"
21-
$NumRows = $Table.Length
22-
Write-Host "⏳ (2/2) Launching Web browser with tabs of dashboard websites... "
23-
foreach($Row in $Table) {
24-
$Name = $Row.NAME
25-
$URL = $Row.URL
26-
Write-Host "$Name · " -noNewline
27-
& "$PSScriptRoot/open-default-browser.ps1" "$URL"
20+
$table = Import-CSV "$PSScriptRoot/../Data/popular-dashboards.csv"
21+
$numRows = $table.Length
22+
Write-Host "⏳ (2/2) Launching Web browser with tabs: " -noNewline
23+
foreach($row in $table) {
24+
Write-Host "$($row.NAME) · " -noNewline
25+
& "$PSScriptRoot/open-default-browser.ps1" "$($row.URL)"
2826
Start-Sleep -milliseconds 50
2927
}
3028
Write-Host ""
3129
[int]$elapsed = $stopWatch.Elapsed.TotalSeconds
32-
"Hint: use switch-tabs.ps1 to switch the browser tabs automatically"
33-
"✅ Opened $NumRows dashboards in $elapsed sec"
30+
"✅ Opened $NumRows dashboards in $elapsed sec (Hint: use switch-tabs.ps1 to switch between browser tabs automatically)"
3431
exit 0 # success
3532
} catch {
3633
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

0 commit comments

Comments
 (0)