major change to override Write-Error func
This commit is contained in:
@@ -10,15 +10,15 @@ If ( IsAdmin )
|
||||
## Install package
|
||||
$Installer = Download-File -URL $URL
|
||||
Try { Start-Process "msiexec.exe" -ArgumentList "/i ${Installer} /qn /norestart DO_NOT_LAUNCH=1" -Wait -ErrorAction Stop }
|
||||
Catch { LogErr $_.Exception.Message ; Exit }
|
||||
Catch { Write-Error $_.Exception.Message ; Exit }
|
||||
|
||||
## Delete installer
|
||||
Try { If ( Test-Path $Installer ) { Remove-Item $Installer -Force } }
|
||||
Catch { LogErr $_.Exception.Message }
|
||||
Catch { Write-Error $_.Exception.Message }
|
||||
|
||||
## Install manager service
|
||||
Try { Start-Process "${Env:ProgramFiles}\WireGuard\wireguard.exe" -ArgumentList '/installmanagerservice' -Wait -ErrorAction SilentlyContinue }
|
||||
Catch { LogErr $_.Exception.Message }
|
||||
Catch { Write-Error $_.Exception.Message }
|
||||
|
||||
## Create shortcut on Public desktop
|
||||
If ( $CreateDesktopShortcut ) {
|
||||
|
||||
Reference in New Issue
Block a user