Skip to content

Instantly share code, notes, and snippets.

@elpatron68
Created May 4, 2024 14:39
Show Gist options
  • Save elpatron68/503bbde77ec3ef3591d1ba86a2c9eb62 to your computer and use it in GitHub Desktop.
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
# 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