major update to override Write-Output func
This commit is contained in:
@@ -3,7 +3,7 @@ $MSIURL = 'https://lfupdate.s3.amazonaws.com/clients/outlook/admin_msi/LiquidFil
|
||||
|
||||
# Set installer args
|
||||
If (-not [string]::IsNullOrEmpty($LFHost) ) {
|
||||
LogMsg "LiquidFiles target server: ${LFHost}"
|
||||
Write-Output "LiquidFiles target server: ${LFHost}"
|
||||
$INSTALLER_ARGS = "REGKEYSCRIPT=""BaseUrl=${LFHost};InjectPositionDefault=3"""
|
||||
}
|
||||
Else { $INSTALLER_ARGS = '' }
|
||||
@@ -11,7 +11,7 @@ Else { $INSTALLER_ARGS = '' }
|
||||
# Stop any running LiquidFilesWindowsAgent process
|
||||
$RunningProcess = Get-Process -Name "LiquidFilesWindowsAgent"
|
||||
If ($RunningProcess) {
|
||||
LogMsg "Stopping the LiquidFiles agent"
|
||||
Write-Output "Stopping the LiquidFiles agent"
|
||||
$RunningProcess | Stop-Process -Force
|
||||
}
|
||||
|
||||
@@ -20,13 +20,13 @@ If ($RunningProcess) {
|
||||
|
||||
# Run the installer
|
||||
$INSTALLER = Download-File -URL $MSIURL
|
||||
LogMsg "Installing Liquid Files Outlook Agent from ""${INSTALLER}"""
|
||||
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 }
|
||||
|
||||
# Delete installer
|
||||
Try {
|
||||
LogMsg "Deleting downloaded installation package"
|
||||
Write-Output "Deleting downloaded installation package"
|
||||
Remove-Item $INSTALLER -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
Catch { LogErr $_.Exception.Message }
|
||||
@@ -40,7 +40,7 @@ If ( Test-Path $PathToAgentExe64 ) {
|
||||
$PathToAgentExe = $PathToAgentExe32
|
||||
}
|
||||
If ($PathToAgentExe) {
|
||||
LogMsg "Starting LiquidFiles agent"
|
||||
Write-Output "Starting LiquidFiles agent"
|
||||
Try { Start-Process $PathToAgentExe }
|
||||
Catch { LogErr $_.Exception.Message }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user