From c056e4ec1e18795303dfb09bc62a645317f034ac Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Fri, 9 Jun 2023 09:38:14 +0200 Subject: [PATCH] Update open-dashboards.ps1 --- Scripts/open-dashboards.ps1 | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/Scripts/open-dashboards.ps1 b/Scripts/open-dashboards.ps1 index 88e84021..be32f85c 100755 --- a/Scripts/open-dashboards.ps1 +++ b/Scripts/open-dashboards.ps1 @@ -2,11 +2,11 @@ .SYNOPSIS Open dashboards .DESCRIPTION - This PowerShell script launches the Web browser with tabs of some dashboard websites. + 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 of dashboard websites... + ⏳ (2/2) Launching Web browser with tabs: Toggl Track · Google Calendar · CNN World News... ... .LINK https://github.com/fleschutz/PowerShell @@ -17,20 +17,17 @@ try { $stopWatch = [system.diagnostics.stopwatch]::startNew() Write-Host "⏳ (1/2) Loading Data/popular-dashboards.csv..." - $Table = Import-CSV "$PSScriptRoot/../Data/popular-dashboards.csv" - $NumRows = $Table.Length - Write-Host "⏳ (2/2) Launching Web browser with tabs of dashboard websites... " - foreach($Row in $Table) { - $Name = $Row.NAME - $URL = $Row.URL - Write-Host "$Name · " -noNewline - & "$PSScriptRoot/open-default-browser.ps1" "$URL" + $table = Import-CSV "$PSScriptRoot/../Data/popular-dashboards.csv" + $numRows = $table.Length + 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 } Write-Host "" [int]$elapsed = $stopWatch.Elapsed.TotalSeconds - "Hint: use switch-tabs.ps1 to switch the browser tabs automatically" - "✅ Opened $NumRows dashboards in $elapsed sec" + "✅ Opened $NumRows 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])"