Skip to content

Commit 5b0c4a8

Browse files
committed
Update install-github-cli.ps1
1 parent 2bf289b commit 5b0c4a8

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

Scripts/install-github-cli.ps1

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,33 @@
22
.SYNOPSIS
33
Installs GitHub CLI
44
.DESCRIPTION
5-
This PowerShell script installs GitHub command-line interface (CLI).
5+
This PowerShell script installs the GitHub command-line interface (CLI).
66
.EXAMPLE
77
PS> ./install-github-cli.ps1
8-
✔ GitHub CLI installed successfully in 9 sec
8+
⏳ Installing GitHub CLI...
9+
✔ Installation of GitHub CLI took 17 sec
910
.LINK
1011
https://github.com/fleschutz/PowerShell
1112
.NOTES
1213
Author: Markus Fleschutz | License: CC0
1314
#>
1415

1516
try {
17+
"⏳ Installing GitHub CLI..."
1618
$StopWatch = [system.diagnostics.stopwatch]::startNew()
1719

1820
if ($IsMacOS) {
1921
& brew install gh
2022
} elseif ($IsLinux) {
21-
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo gpg --dearmor -o /usr/share/keyrings/githubcli-archive-keyring.gpg
23+
& curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo gpg --dearmor -o /usr/share/keyrings/githubcli-archive-keyring.gpg
2224
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
23-
sudo apt update
24-
sudo apt install gh
25+
& sudo apt update
26+
& sudo apt install gh
2527
} else {
2628
& winget install --id GitHub.cli
27-
29+
}
2830
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
29-
"✔️ GitHub CLI installed successfully in $Elapsed sec"
31+
"✔️ Installation of GitHub CLI took $Elapsed sec"
3032
exit 0 # success
3133
} catch {
3234
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

0 commit comments

Comments
 (0)