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

View File

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