mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-12 06:02:56 +02:00
Updated the manuals
This commit is contained in:
79
docs/install-syncthing.md
Normal file
79
docs/install-syncthing.md
Normal file
@ -0,0 +1,79 @@
|
||||
The *install-syncthing.ps1* Script
|
||||
===========================
|
||||
|
||||
This PowerShell script installs Syncthing on your computer.
|
||||
Syncthing is a continuous file synchronization program. See https://syncthing.net for details.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
```powershell
|
||||
/Repos/PowerShell/scripts/install-syncthing.ps1 [<CommonParameters>]
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
Example
|
||||
-------
|
||||
```powershell
|
||||
PS> ./install-syncthing.ps1
|
||||
⏳ Installing Syncthing from WinGet...
|
||||
...
|
||||
|
||||
```
|
||||
|
||||
Notes
|
||||
-----
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
Related Links
|
||||
-------------
|
||||
navigationLink
|
||||
--------------
|
||||
{@{uri=Author: Markus Fleschutz | License: CC0}, @{linkText=Author: Markus Fleschutz | License: CC0}}
|
||||
|
||||
Script Content
|
||||
--------------
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Installs Syncthing
|
||||
.DESCRIPTION
|
||||
This PowerShell script installs Syncthing on your computer.
|
||||
Syncthing is a continuous file synchronization program. See https://syncthing.net for details.
|
||||
.EXAMPLE
|
||||
PS> ./install-syncthing.ps1
|
||||
⏳ Installing Syncthing from WinGet...
|
||||
...
|
||||
.LINK
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
.NOTES
|
||||
https://github.com/fleschutz/PowerShell
|
||||
#>
|
||||
|
||||
try {
|
||||
$stopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||
|
||||
if ($IsLinux) {
|
||||
"⏳ Installing Syncthing..."
|
||||
& sudo apt install syncthing
|
||||
} else {
|
||||
"⏳ Installing Syncthing from WinGet..."
|
||||
& winget install --id Syncthing.Syncthing --accept-package-agreements --accept-source-agreements
|
||||
|
||||
"⏳ Starting Syncthing as daemon..."
|
||||
Start-Process -NoNewWindow "$env:LOCALAPPDATA\Microsoft\WinGet\Links\syncthing.exe"
|
||||
}
|
||||
[int]$elapsed = $stopWatch.Elapsed.TotalSeconds
|
||||
"✅ Syncthing installed successfully in $($elapsed)s."
|
||||
" Web interface: http://127.0.0.1:8384 (open by: <Ctrl> <click>)"
|
||||
" Sync folder at: ~/Sync/ (execute: cd-sync.ps1)"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*(page generated by convert-ps2md.ps1 as of 06/22/2025 10:37:37)*
|
Reference in New Issue
Block a user