Files
management-scripts/Install-Wireguard.ps1
T
dyoder ae42120f1f cleanup after finished (Fix-AutodeskProductLicensing.ps1)
add service installation (Install-Wireguard.ps1)
2020-12-23 08:16:37 -05:00

23 lines
1.0 KiB
PowerShell

## Create a desktop shortcut for WireGuard?
$CreateDesktopShortcut = $true
## Make sure we have an administrative token
If ( IsAdmin )
{
If ( Is64bit ) { $URL = 'https://download.wireguard.com/windows-client/wireguard-amd64-latest.msi' }
Else { $URL = 'https://download.wireguard.com/windows-client/wireguard-x86-latest.msi' }
## Install package
Try { Start-Process "msiexec.exe" -ArgumentList "/i ${URL} /qn /norestart DO_NOT_LAUNCH=1" -Wait -ErrorAction Stop }
Catch { LogErr $_.Exception.Message ; Exit }
## Install manager service
Try { Start-Process "wireguard.exe" -ArgumentList '/installmanagerservice' -Wait -ErrorAction SilentlyContinue }
Catch { LogErr $_.Exception.Message }
## Create shortcut on Public desktop
If ( $CreateDesktopShortcut ) {
Create-Shortcut -Path "${Env:Public}\Desktop\WireGuard VPN.LNK" -TargetPath "${Env:ProgramFiles}\WireGuard\wireguard.exe" -Description "WireGuard: Fast, Modern, Secure VPN Tunnel"
}
}
Else { LogMsg "Must be an administrator to install WireGuard" }