Add install-signal-cli.ps1

This commit is contained in:
Markus Fleschutz 2021-06-29 20:29:22 +02:00
parent f036207cc9
commit 708d3c3998
3 changed files with 36 additions and 0 deletions

View File

@ -74,6 +74,7 @@ generate-qrcode.ps1, generates a QR code
hibernate.ps1, enables hibernate mode for the local computer (needs admin rights)
inspect-exe.ps1, prints basic information of the given executable file
install-google-chrome.ps1, installs the Google Chrome browser
install-signal-cli.ps1, installs signal-cli from github.com/AsamK/signal-cli
introduce-powershell.ps1, introduces PowerShell to new users
list-aliases.ps1, lists all PowerShell aliases
list-anagrams.ps1, lists all anagrams of the given word

1 Script Description
74 hibernate.ps1 enables hibernate mode for the local computer (needs admin rights)
75 inspect-exe.ps1 prints basic information of the given executable file
76 install-google-chrome.ps1 installs the Google Chrome browser
77 install-signal-cli.ps1 installs signal-cli from github.com/AsamK/signal-cli
78 introduce-powershell.ps1 introduces PowerShell to new users
79 list-aliases.ps1 lists all PowerShell aliases
80 list-anagrams.ps1 lists all anagrams of the given word

View File

@ -48,6 +48,7 @@ Mega Collection of PowerShell Scripts
* [enable-ssh-server.ps1](Scripts/enable-ssh-server.ps1) - enables the SSH server (needs admin rights)
* [hibernate.ps1](Scripts/hibernate.ps1) - enables hibernate mode for the local computer (needs admin rights)
* [install-google-chrome.ps1](Scripts/install-google-chrome.ps1) - installs the Google Chrome browser
* [install-signal-cli.ps1](Scripts/install-signal-cli.ps1) - installs signal-cli from github.com/AsamK/signal-cli
* [list-drives.ps1](Scripts/list-drives.ps1) - lists all drives
* [list-network-shares.ps1](Scripts/list-network-shares.ps1) - lists the network shares of the local computer
* [list-installed-apps.ps1](Scripts/list-installed-apps.ps1) - lists the installed Windows Store apps

34
Scripts/install-signal-cli.ps1 Executable file
View File

@ -0,0 +1,34 @@
<#
.SYNTAX install-signal-cli.ps1 [<version>]
.DESCRIPTION installs signal-cli from github.com/AsamK/signal-cli
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
param($Version = "")
if ($Version -eq "") { $Version = read-host "Enter version to install (see https://github.com/AsamK/signal-cli)" }
try {
$StopWatch = [system.diagnostics.stopwatch]::startNew()
set-location /tmp
& wget --version
if ($lastExitCode -ne "0") { throw "Can't execute 'wget' - make sure wget is installed and available" }
& wget "https://github.com/AsamK/signal-cli/releases/download/v$Version/signal-cli-$($Version).tar.gz"
if ($lastExitCode -ne "0") { throw "'wget' failed" }
sudo tar xf "signal-cli-$Version.tar.gz" -C /opt
if ($lastExitCode -ne "0") { throw "'sudo tar xf' failed" }
sudo ln -sf "/opt/signal-cli-$Version)/bin/signal-cli" /usr/local/bin/
if ($lastExitCode -ne "0") { throw "'sudo ln -sf' failed" }
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
"✔️ installed signal-cli $Version to /opt and /usr/local/bin in $Elapsed sec"
exit 0
} catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}