mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-29 11:24:27 +01:00
Update open-dashboards.ps1
This commit is contained in:
parent
99805974ef
commit
78378f1128
@ -5,8 +5,8 @@
|
|||||||
This PowerShell script launches the web browser with tabs of 18 dashboard websites.
|
This PowerShell script launches the web browser with tabs of 18 dashboard websites.
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
PS> ./open-dashboards.ps1
|
PS> ./open-dashboards.ps1
|
||||||
⏳ (1/2) Loading Data/web-dashboards.csv...
|
⏳ (1/2) Reading Data/popular-dashboards.csv...
|
||||||
⏳ (2/2) Launching web browser with tabs of Toggl Track · Google Calendar · CNN News...
|
⏳ (2/2) Launching web browser tabs with: Toggl Track · Google Calendar · CNN News...
|
||||||
...
|
...
|
||||||
.LINK
|
.LINK
|
||||||
https://github.com/fleschutz/PowerShell
|
https://github.com/fleschutz/PowerShell
|
||||||
@ -16,10 +16,10 @@
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
$stopWatch = [system.diagnostics.stopwatch]::startNew()
|
$stopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||||
Write-Host "⏳ (1/2) Loading Data/web-dashboards.csv..."
|
Write-Host "⏳ (1/2) Reading Data/popular-dashboards.csv..."
|
||||||
$table = Import-CSV "$PSScriptRoot/../Data/web-dashboards.csv"
|
$table = Import-CSV "$PSScriptRoot/../Data/popular-dashboards.csv"
|
||||||
$numRows = $table.Length
|
$numRows = $table.Length
|
||||||
Write-Host "⏳ (2/2) Launching web browser with tabs of " -noNewline
|
Write-Host "⏳ (2/2) Launching web browser tabs with: " -noNewline
|
||||||
foreach($row in $table) {
|
foreach($row in $table) {
|
||||||
Write-Host "$($row.NAME) · " -noNewline
|
Write-Host "$($row.NAME) · " -noNewline
|
||||||
& "$PSScriptRoot/open-default-browser.ps1" "$($row.URL)"
|
& "$PSScriptRoot/open-default-browser.ps1" "$($row.URL)"
|
||||||
@ -27,7 +27,7 @@ try {
|
|||||||
}
|
}
|
||||||
Write-Host ""
|
Write-Host ""
|
||||||
[int]$elapsed = $stopWatch.Elapsed.TotalSeconds
|
[int]$elapsed = $stopWatch.Elapsed.TotalSeconds
|
||||||
"✅ Opened $NumRows web dashboards in $elapsed sec (Hint: use 'switch-tabs.ps1' to switch between the tabs automatically)"
|
"✅ Opened $NumRows dashboards in $elapsed sec (Hint: use 'switch-tabs.ps1' to switch between the tabs automatically)"
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
Loading…
Reference in New Issue
Block a user