Updated install-syncthing.ps1 and list-cli-tools.ps1

This commit is contained in:
Markus Fleschutz 2025-05-18 11:05:52 +02:00
parent d8ebaae190
commit 5e2b19c7f3
2 changed files with 11 additions and 6 deletions

View File

@ -6,7 +6,7 @@
Syncthing is a continuous file synchronization program. See https://syncthing.net for details. Syncthing is a continuous file synchronization program. See https://syncthing.net for details.
.EXAMPLE .EXAMPLE
PS> ./install-syncthing.ps1 PS> ./install-syncthing.ps1
Installing Syncthing... Installing Syncthing from WinGet...
... ...
.LINK .LINK
Author: Markus Fleschutz | License: CC0 Author: Markus Fleschutz | License: CC0
@ -15,20 +15,24 @@
#> #>
try { try {
"⏳ Installing Syncthing..."
$stopWatch = [system.diagnostics.stopwatch]::startNew() $stopWatch = [system.diagnostics.stopwatch]::startNew()
if ($IsLinux) { if ($IsLinux) {
"⏳ Installing Syncthing..."
& sudo apt install syncthing & sudo apt install syncthing
} else { } else {
& winget install --id Syncthing.Syncthing "⏳ 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 [int]$elapsed = $stopWatch.Elapsed.TotalSeconds
"✅ Syncthing installed successfully in $($elapsed)s." "✅ Syncthing installed successfully in $($elapsed)s."
" Adming GUI at: http://127.0.0.1:8384 (use <Ctrl> <click>)" " Web interface: http://127.0.0.1:8384 (open by: <Ctrl> <click>)"
" Your sync folder is at: ~/Sync/" " Sync folder at: ~/Sync/ (execute: cd-sync.ps1)"
exit 0 # success exit 0 # success
} catch { } catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error: $($Error[0])"
exit 1 exit 1
} }

View File

@ -288,6 +288,7 @@ function List-CLI-Tools {
ListTool strings "--version" ListTool strings "--version"
ListTool strip "--version" ListTool strip "--version"
ListTool sudo "--version" ListTool sudo "--version"
ListTool syncthing "--version"
ListTool systeminfo "" ListTool systeminfo ""
ListTool tail "--version" ListTool tail "--version"
ListTool tar "--version" ListTool tar "--version"