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
@@ -22,14 +22,14 @@ If ($RunningProcess) {
$INSTALLER = Download-File -URL $MSIURL
Write-Output "Installing Liquid Files Outlook Agent from ""${INSTALLER}"""
Try { Start-Process "msiexec.exe" -ArgumentList "/i ${INSTALLER} /qn /norestart ${INSTALLER_ARGS}" -Wait -ErrorAction Stop }
Catch { LogErr $_.Exception.Message }
Catch { Write-Error $_.Exception.Message }
# Delete installer
Try {
Write-Output "Deleting downloaded installation package"
Remove-Item $INSTALLER -Force -ErrorAction SilentlyContinue
}
Catch { LogErr $_.Exception.Message }
Catch { Write-Error $_.Exception.Message }
# Start the agent
$PathToAgentExe64 = "${Env:ProgramFiles(x86)}\LiquidFiles Windows Agent\LiquidFilesWindowsAgent.exe"
@@ -42,5 +42,5 @@ If ( Test-Path $PathToAgentExe64 ) {
If ($PathToAgentExe) {
Write-Output "Starting LiquidFiles agent"
Try { Start-Process $PathToAgentExe }
Catch { LogErr $_.Exception.Message }
Catch { Write-Error $_.Exception.Message }
}