Files
management-scripts/Install-Wireguard.ps1
T

20 lines
806 B
PowerShell
Raw Normal View History

2020-11-19 17:50:42 -05:00
## Make sure we have an administrative token
If ( IsAdmin )
{
$URL = "https://download.wireguard.com/windows-client/wireguard-installer.exe"
2020-11-19 17:50:42 -05:00
2020-12-03 18:16:55 -05:00
## Download package
$Installer = Download-File -URL $URL
2020-12-03 17:48:24 -05:00
If ( Test-Path $Installer ) {
2020-12-03 18:16:55 -05:00
## Install package
2020-12-03 17:50:22 -05:00
End-Process -Name "wireguard" -Match -Force
2020-12-03 17:48:24 -05:00
Install-Program -Path "${Installer}" -Delete
2020-12-03 17:50:22 -05:00
End-Process -Name "wireguard" -Match -Force
2020-12-03 18:16:55 -05:00
## Create shortcut on Public desktop
#Create-Shortcut -Path "${Env:Public}\Desktop\WireGuard.LNK" -TargetPath "${Env:ProgramFiles}\WireGuard\wireguard.exe" -Description "WireGuard: Fast, Modern, Secure VPN Tunnel"
2020-12-03 17:48:24 -05:00
}
Else { LogMsg "The WireGuard installer was not downloaded properly" }
2020-11-19 17:50:42 -05:00
}
Else { LogMsg "Must be an administrator to install WireGuard" }