Last active
February 13, 2022 21:05
-
-
Save wise-io/3b0ea45654a30fb77d6b363a6ef40663 to your computer and use it in GitHub Desktop.
Downloads Splashtop SOS & Creates Shortcut
This file contains hidden or 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
SplashtopSOS.ps1 | |
# Downloads Splashtop SOS & creates desktop shortcut | |
$Executable = "$env:SystemDrive\Utilities\SplashtopSOS.exe" | |
$DownloadURL = 'https://download.splashtop.com/sos/SplashtopSOS.exe' | |
try { | |
# Create Directory | |
if (!(Test-Path (Split-Path $Executable))) { New-Item -ItemType Directory -Force -Path (Split-Path $Executable) } | |
# Download Splashtop SOS | |
Write-Output 'Downloading Splashtop SOS...' | |
Invoke-WebRequest -Uri $DownloadURL -OutFile $Executable | |
# Create Public Desktop Shortcut | |
Write-Output 'Creating desktop shortcut...' | |
$ShortcutFile = "$env:Public\Desktop\Splashtop SOS.lnk" | |
$WScriptShell = New-Object -ComObject WScript.Shell | |
$Shortcut = $WScriptShell.CreateShortcut($ShortcutFile) | |
$Shortcut.TargetPath = $Executable | |
$Shortcut.Save() | |
} | |
catch { throw $Error } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment