Files
management-scripts/Install-LiquidFilesOutlookAgent.ps1
T

34 lines
1.2 KiB
PowerShell
Raw Normal View History

## Path to the MSI installer
$MSIURL = 'https://lfupdate.s3.amazonaws.com/clients/outlook/admin_msi/LiquidFiles_Admin_2.0.129.msi'
2020-07-31 12:44:03 -04:00
Install-PSAteraModule
Import-Module -Name PSAtera
## Get LF host URL from Atera
2021-10-07 09:40:42 -04:00
LogMsg "Getting LiquidFiles host URL from Atera API"
Try {
Set-AteraAPIKey -APIKey $AteraAPIKey
$AteraAgent = Get-AteraAgent
$LFHost = $(Get-AteraCustomValue -ObjectType Customer -ObjectId $AteraAgent.CustomerID -FieldName 'LiquidFiles Host URL').ValueAsString
}
Catch { LogErr $_.Exception.Message }
2020-07-31 12:44:03 -04:00
## Set installer args
If (-not [string]::IsNullOrEmpty($LFHost) ) {
2021-08-10 13:28:34 -04:00
LogMsg "LiquidFiles target server: ${LFHost}"
$INSTALLER_ARGS = "REGKEYSCRIPT=""BaseUrl=${LFHost};"""
2020-07-31 12:44:03 -04:00
}
Else { $INSTALLER_ARGS = '' }
## Run the installer
2021-05-06 11:57:17 -04:00
$INSTALLER = Download-File -URL $MSIURL
LogMsg "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 {
2021-05-24 14:05:59 -04:00
LogMsg "Deleting downloaded installation package"
Remove-Item $INSTALLER -Force -ErrorAction SilentlyContinue
2021-05-06 11:57:17 -04:00
}
Catch { LogErr $_.Exception.Message }