Update cd-repo.ps1 and open-dashboards.ps1

This commit is contained in:
Markus Fleschutz 2024-05-17 08:04:54 +02:00
parent 1f51d6ab66
commit c77f271268
2 changed files with 10 additions and 11 deletions

View File

@ -7,8 +7,7 @@
Specifies the folder name
.EXAMPLE
PS> ./cd-repo.ps1 rust
📂C:\Users\Markus\Repos\rust
on branch: ## main ... origin/main
📂C:\Repos\rust on Git branch: ## main ... origin/main
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
@ -38,7 +37,7 @@ try {
if (-not(Test-Path "$path" -pathType Container)) { throw "The path to 📂$path doesn't exist (yet)" }
$path = Resolve-Path "$path"
Set-Location "$path"
Write-Host "📂$path • on branch: " -noNewline
Write-Host "📂$path • on Git branch: " -noNewline
& git status --short --branch --show-stash
exit 0 # success

View File

@ -3,11 +3,11 @@
Open web dashboards
.DESCRIPTION
This PowerShell script launches the Web browser with 20 tabs of popular dashboard websites.
.PARAMETER interval
Specifies the time interval (110ms per default)
.PARAMETER timeInterval
Specifies the time interval between each tab (110ms per default)
.EXAMPLE
PS> ./open-dashboards.ps1
Launching Web browser with 20 tabs showing: Toggl Track, Google Calendar, Google Mail, ...
Launching Web browser with 20 tabs showing Toggl TrackGoogle CalendarGoogle Mail, ...
NOTE: Execute './switch-tabs.ps1' to switch from tab to tab automatically.
...
.LINK
@ -16,19 +16,19 @@
Author: Markus Fleschutz | License: CC0
#>
param([int]$interval = 110) # milliseconds
param([int]$timeInterval = 110) # milliseconds
try {
Write-Progress "Reading Data/popular-dashboards.csv..."
$table = Import-CSV "$PSScriptRoot/../data/popular-dashboards.csv"
$numRows = $table.Length
Write-Progress -completed "Done."
Write-Host "✅ Launching Web browser with 20 tabs showing: " -noNewline
Write-Host "✅ Launching Web browser with 20 tabs showing " -noNewline
$numRows = $table.Length
foreach($row in $table) {
Write-Host "$($row.NAME), " -noNewline
Write-Host "$($row.NAME)" -noNewline
& "$PSScriptRoot/open-default-browser.ps1" "$($row.URL)"
Start-Sleep -milliseconds $interval
Start-Sleep -milliseconds $timeInterval
}
Write-Host ""
Write-Host "NOTE: Execute './switch-tabs.ps1' to switch from tab to tab automatically."