Created
May 4, 2024 14:39
-
-
Save elpatron68/503bbde77ec3ef3591d1ba86a2c9eb62 to your computer and use it in GitHub Desktop.
Downloads Rustdesk client, saves it with host and key in file name, creates desktop shortcut
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Powershell Rustdesk Download/Shortcut Script | |
# Derived from https://rustdesk.com/docs/en/self-host/client-deployment/ | |
# 05/2024 [email protected] | |
# | |
# Changes: | |
# - Replaced static download uri with latest release from Github Api | |
$ErrorActionPreference = 'silentlycontinue' | |
$HostIp = "<your host ip or fqdn>" | |
$key = "<your key>" | |
$ExecutableFileName = "rustdesk-host=$HostIp,key=$key-qs.exe" | |
$FullExecutablePath = [IO.Path]::Combine($env:LOCALAPPDATA, $ExecutableFileName) | |
Write-Output "Suche neueste Version von Rustdesk" | |
$repo = "rustdesk/rustdesk" | |
$filenamePattern = "*x86_64.exe" | |
$releasesUri = "https://api.github.com/repos/$repo/releases/latest" | |
$downloadUri = ((Invoke-RestMethod -Method GET -Uri $releasesUri).assets | Where-Object name -like $filenamePattern ).browser_download_url | |
# Download nach %APPDATA% | |
If (Test-Path $FullExecutablePath) { | |
Remove-Item $FullExecutablePath | |
} | |
Write-Output "Lade Rustdesk Client herunter..." | |
$ProgressPreference = 'SilentlyContinue' | |
Invoke-WebRequest $downloadUri -Outfile $FullExecutablePath | |
$ProgressPreference = 'Continue' | |
Write-Output "Rustdesk Client wurde gespeichert." | |
# Desktopverknüpfung erstellen | |
Write-Output "Erstelle Desktopverknüpfung" | |
$WshShell = New-Object -comObject WScript.Shell | |
$Shortcut = $WshShell.CreateShortcut("$Home\Desktop\Rustdesk-QS.lnk") | |
$Shortcut.TargetPath = $FullExecutablePath | |
$Shortcut.Save() | |
Write-Output "Installation von Rustdesk Client abgeschlossen." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment