## Make sure we have an administrative token If ( IsAdmin ) { $URL = "https://download.wireguard.com/windows-client/wireguard-installer.exe" ## Download package $Installer = Download-File -URL $URL If ( Test-Path $Installer ) { ## Install package End-Process -Name "wireguard" -Match -Force Install-Program -Path "${Installer}" -Delete End-Process -Name "wireguard" -Match -Force ## 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" } Else { LogMsg "The WireGuard installer was not downloaded properly" } } Else { LogMsg "Must be an administrator to install WireGuard" }