2020-11-19 17:50:42 -05:00
|
|
|
## Make sure we have an administrative token
|
|
|
|
|
If ( IsAdmin )
|
|
|
|
|
{
|
2020-12-03 17:13:13 -05:00
|
|
|
$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
|
2020-12-03 17:13:13 -05:00
|
|
|
$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
|
2020-12-03 20:18:23 -05:00
|
|
|
#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
|
|
|
}
|
2020-12-03 20:18:23 -05:00
|
|
|
Else { LogMsg "The WireGuard installer was not downloaded properly" }
|
2020-11-19 17:50:42 -05:00
|
|
|
}
|
2020-12-03 20:18:23 -05:00
|
|
|
Else { LogMsg "Must be an administrator to install WireGuard" }
|