update to use atera api to get customer host url

This commit is contained in:
2021-10-07 09:29:46 -04:00
parent e9742704ff
commit fe795e4ba1
+13 -1
View File
@@ -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};"""
}