major change to override Write-Error func

This commit is contained in:
2023-10-05 13:17:18 -04:00
parent bbb4884818
commit 5f4b4565de
42 changed files with 114 additions and 114 deletions
+3 -3
View File
@@ -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 ) {