Files
management-scripts/Install-Wireguard.ps1
T

19 lines
849 B
PowerShell

## Create a desktop shortcut for WireGuard?
$CreateDesktopShortcut = $false
## 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 }
Catch { LogErr $_.Exception.Message }
## Create shortcut on Public desktop
If ( $CreateDesktopShortcut ) {
Create-Shortcut -Path "${Env:Public}\Desktop\WireGuard.LNK" -TargetPath "${Env:ProgramFiles}\WireGuard\wireguard.exe" -Description "WireGuard: Fast, Modern, Secure VPN Tunnel"
}
}
Else { LogMsg "Must be an administrator to install WireGuard" }