diff --git a/Scripts/install-google-chrome.ps1 b/Scripts/install-google-chrome.ps1 index 06ed73de..0b6f3b97 100755 --- a/Scripts/install-google-chrome.ps1 +++ b/Scripts/install-google-chrome.ps1 @@ -1,7 +1,20 @@ -### Silently installs latest google chrome ### -$Path = $env:TEMP; -$Installer = "chrome_installer.exe" -Invoke-WebRequest "http://dl.google.com/chrome/install/latest/chrome_installer.exe" -OutFile $Path\$Installer -Start-Process -FilePath $Path\$Installer -Args "/silent /install" -Verb RunAs -Wait -Remove-Item $Path\$Installer -exit 0 +#!/usr/bin/pwsh +<# +.SYNTAX install-google-chrome.ps1 +.DESCRIPTION silently installs latest Google Chrome +.LINK https://github.com/fleschutz/PowerShell +.NOTES Author: Markus Fleschutz / License: CC0 +#> + +try { + $Path = $env:TEMP; + $Installer = "chrome_installer.exe" + Invoke-WebRequest "http://dl.google.com/chrome/install/latest/chrome_installer.exe" -OutFile $Path\$Installer + Start-Process -FilePath $Path\$Installer -Args "/silent /install" -Verb RunAs -Wait + Remove-Item $Path\$Installer + write-host -foregroundColor green "✔️ installed Google Chrome" + exit 0 +} catch { + write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" + exit 1 +} diff --git a/Scripts/pull-repo.ps1 b/Scripts/pull-repo.ps1 index edc883fc..6b6d885a 100755 --- a/Scripts/pull-repo.ps1 +++ b/Scripts/pull-repo.ps1 @@ -1,4 +1,4 @@ -#!/usr/bin/pwsh +#!/usr/bin/pwsh <# .SYNTAX pull-repo.ps1 [] .DESCRIPTION pulls updates for the current/given Git repository (including submodules) @@ -9,7 +9,7 @@ param($RepoDir = "$PWD") try { - write-output "Pulling updates for Git repository $RepoDir ..." + "→ Pulling updates for Git repository $RepoDir ..." if (-not(test-path "$RepoDir" -pathType container)) { throw "Can't access directory: $RepoDir" } set-location "$RepoDir" @@ -20,7 +20,7 @@ try { & git status if ($lastExitCode -ne "0") { throw "'git status' failed" } - write-host -foregroundColor green "OK - pulled updates for Git repository $RepoDir" + write-host -foregroundColor green "✔️ updates pulled for Git repository $RepoDir" exit 0 } catch { write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" diff --git a/Scripts/pull-repos.ps1 b/Scripts/pull-repos.ps1 index 1b3ce9b9..f95abe74 100755 --- a/Scripts/pull-repos.ps1 +++ b/Scripts/pull-repos.ps1 @@ -30,7 +30,7 @@ try { $Count++ } - write-host -foregroundColor green "OK - pulled updates for $Count Git repositories under $ParentDir in $($StopWatch.Elapsed.Seconds) second(s)" + write-host -foregroundColor green "✔️ pulled updates for $Count Git repositories under $ParentDir in $($StopWatch.Elapsed.Seconds) second(s)" exit 0 } catch { write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" diff --git a/Scripts/switch-branch.ps1 b/Scripts/switch-branch.ps1 index 2a513271..4bc8138c 100755 --- a/Scripts/switch-branch.ps1 +++ b/Scripts/switch-branch.ps1 @@ -1,4 +1,4 @@ -#!/usr/bin/pwsh +#!/usr/bin/pwsh <# .SYNTAX switch-branch.ps1 [] [] .DESCRIPTION switches the branch in the current/given Git repository (including submodules) @@ -7,10 +7,7 @@ #> param($BranchName = "", $RepoDir = "$PWD") - -if ($BranchName -eq "") { - $BranchName = read-host "Enter name of branch to switch to" -} +if ($BranchName -eq "") { $BranchName = read-host "Enter name of branch to switch to" } try { if (-not(test-path "$RepoDir" -pathType container)) { throw "Can't access directory: $RepoDir" }