File tree 1 file changed +9
-7
lines changed
1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change 2
2
. SYNOPSIS
3
3
Installs GitHub CLI
4
4
. DESCRIPTION
5
- This PowerShell script installs GitHub command-line interface (CLI).
5
+ This PowerShell script installs the GitHub command-line interface (CLI).
6
6
. EXAMPLE
7
7
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
9
10
. LINK
10
11
https://github.com/fleschutz/PowerShell
11
12
. NOTES
12
13
Author: Markus Fleschutz | License: CC0
13
14
#>
14
15
15
16
try {
17
+ " ⏳ Installing GitHub CLI..."
16
18
$StopWatch = [system.diagnostics.stopwatch ]::startNew()
17
19
18
20
if ($IsMacOS ) {
19
21
& brew install gh
20
22
} 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
22
24
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
25
27
} else {
26
28
& winget install -- id GitHub.cli
27
-
29
+ }
28
30
[int ]$Elapsed = $StopWatch.Elapsed.TotalSeconds
29
- " ✔️ GitHub CLI installed successfully in $Elapsed sec"
31
+ " ✔️ Installation of GitHub CLI took $Elapsed sec"
30
32
exit 0 # success
31
33
} catch {
32
34
" ⚠️ Error in line $ ( $_.InvocationInfo.ScriptLineNumber ) : $ ( $Error [0 ]) "
You can’t perform that action at this time.
0 commit comments