mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-22 01:48:20 +02:00
Add install-github-cli.ps1
This commit is contained in:
parent
d55bf05845
commit
945c07606e
@ -75,6 +75,7 @@ fetch-repos.ps1, fetches updates for all Git repositories under the current/give
|
|||||||
generate-qrcode.ps1, generates a QR code
|
generate-qrcode.ps1, generates a QR code
|
||||||
hibernate.ps1, enables hibernate mode for the local computer (needs admin rights)
|
hibernate.ps1, enables hibernate mode for the local computer (needs admin rights)
|
||||||
inspect-exe.ps1, prints basic information of the given executable file
|
inspect-exe.ps1, prints basic information of the given executable file
|
||||||
|
install-github-cli.ps1, installs GitHub CLI
|
||||||
install-google-chrome.ps1, installs the Google Chrome browser
|
install-google-chrome.ps1, installs the Google Chrome browser
|
||||||
install-knot-resolver.ps1, installs the Knot Resolver (needs admin rights)
|
install-knot-resolver.ps1, installs the Knot Resolver (needs admin rights)
|
||||||
install-signal-cli.ps1, installs signal-cli from github.com/AsamK/signal-cli
|
install-signal-cli.ps1, installs signal-cli from github.com/AsamK/signal-cli
|
||||||
|
|
@ -53,6 +53,7 @@ Mega Collection of PowerShell Scripts
|
|||||||
* [check-windows-system-files.ps1](Scripts/check-windows-system-files.ps1) - checks the validity of the Windows system files (needs admin rights)
|
* [check-windows-system-files.ps1](Scripts/check-windows-system-files.ps1) - checks the validity of the Windows system files (needs admin rights)
|
||||||
* [enable-crash-dumps.ps1](Scripts/enable-crash-dumps.ps1) - enables the writing of crash dumps
|
* [enable-crash-dumps.ps1](Scripts/enable-crash-dumps.ps1) - enables the writing of crash dumps
|
||||||
* [hibernate.ps1](Scripts/hibernate.ps1) - enables hibernate mode for the local computer (needs admin rights)
|
* [hibernate.ps1](Scripts/hibernate.ps1) - enables hibernate mode for the local computer (needs admin rights)
|
||||||
|
* [install-github-cli.ps1](Scripts/install-github-cli.ps1) - installs GitHub CLI
|
||||||
* [install-google-chrome.ps1](Scripts/install-google-chrome.ps1) - installs the Google Chrome browser
|
* [install-google-chrome.ps1](Scripts/install-google-chrome.ps1) - installs the Google Chrome browser
|
||||||
* [install-knot-resolver.ps1](Scripts/install-knot-resolver.ps1) - installs the Knot Resolver (needs admin rights)
|
* [install-knot-resolver.ps1](Scripts/install-knot-resolver.ps1) - installs the Knot Resolver (needs admin rights)
|
||||||
* [install-ssh-client.ps1](Scripts/install-ssh-client.ps1) - installs the SSH client (needs admin rights)
|
* [install-ssh-client.ps1](Scripts/install-ssh-client.ps1) - installs the SSH client (needs admin rights)
|
||||||
|
33
Scripts/install-github-cli.ps1
Normal file
33
Scripts/install-github-cli.ps1
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
install-github-cli.ps1
|
||||||
|
.DESCRIPTION
|
||||||
|
Installs GitHub CLI
|
||||||
|
.EXAMPLE
|
||||||
|
PS> .\install-github-cli.ps1
|
||||||
|
.LINK
|
||||||
|
https://github.com/fleschutz/PowerShell
|
||||||
|
.NOTES
|
||||||
|
Author: Markus Fleschutz
|
||||||
|
License: CC0
|
||||||
|
#>
|
||||||
|
|
||||||
|
try {
|
||||||
|
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||||
|
|
||||||
|
if ($IsMacOS) {
|
||||||
|
brew install gh
|
||||||
|
} elseif ($IsLinux) {
|
||||||
|
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo gpg --dearmor -o /usr/share/keyrings/githubcli-archive-keyring.gpg
|
||||||
|
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
|
||||||
|
sudo apt update
|
||||||
|
sudo apt install gh
|
||||||
|
}
|
||||||
|
|
||||||
|
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||||
|
"✔️ installed GitHub CLI in $Elapsed sec"
|
||||||
|
exit 0
|
||||||
|
} catch {
|
||||||
|
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
exit 1
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user