diff --git a/Install-LiquidFilesOutlookAgent.ps1 b/Install-LiquidFilesOutlookAgent.ps1 index 30f6387..ab85364 100644 --- a/Install-LiquidFilesOutlookAgent.ps1 +++ b/Install-LiquidFilesOutlookAgent.ps1 @@ -1,8 +1,20 @@ ## Path to the MSI installer $MSIURL = 'https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/resources/LiquidFiles_Admin_2.0.129.msi' +Install-PSAteraModule +Import-Module -Name PSAtera + +## Get LF host URL from Atera +Try { + LogMsg "Getting LiquidFiles host URL from Atera API" + Set-AteraAPIKey -APIKey $AteraAPIKey + $AteraAgent = Get-AteraAgent + $LFHost = $(Get-AteraCustomValue -ObjectType Customer -ObjectId $AteraAgent.CustomerID -FieldName 'LiquidFiles Host URL').ValueAsString +} +Catch { LogErr $_.Exception.Message } + ## Set installer args -If ( $LFHost ) { +If (-not [string]::IsNullOrEmpty($LFHost) ) { LogMsg "LiquidFiles target server: ${LFHost}" $INSTALLER_ARGS = "REGKEYSCRIPT=""BaseUrl=${LFHost};""" }