mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-05-31 23:45:48 +02:00
Added install-syncthing.ps1
This commit is contained in:
parent
3399b4a6df
commit
0cbe8e69c4
29
scripts/install-syncthing.ps1
Normal file
29
scripts/install-syncthing.ps1
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Installs Syncthing
|
||||||
|
.DESCRIPTION
|
||||||
|
This PowerShell scripts installs Syncthing on your computer.
|
||||||
|
.EXAMPLE
|
||||||
|
PS> ./install-syncthing.ps1
|
||||||
|
.LINK
|
||||||
|
Author: Markus Fleschutz | License: CC0
|
||||||
|
.NOTES
|
||||||
|
https://github.com/fleschutz/PowerShell
|
||||||
|
#>
|
||||||
|
|
||||||
|
try {
|
||||||
|
"⏳ Installing Syncthing..."
|
||||||
|
$stopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||||
|
|
||||||
|
if ($IsLinux) {
|
||||||
|
& sudo apt install syncthing
|
||||||
|
} else {
|
||||||
|
& winget install --id Syncthing.Syncthing
|
||||||
|
}
|
||||||
|
[int]$elapsed = $stopWatch.Elapsed.TotalSeconds
|
||||||
|
"✅ Syncthing installed successfully in $($elapsed)s. Visit 127.0.0.1:8384 for setup and see the ~/Sync folder"
|
||||||
|
exit 0 # success
|
||||||
|
} catch {
|
||||||
|
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
exit 1
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user