Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7825a5eb21 | ||
|
|
fe795e4ba1 | ||
|
|
e9742704ff | ||
|
|
641e88bd78 |
@@ -0,0 +1,25 @@
|
||||
$Global:_FixAteraAgentRestartAgent = $false
|
||||
|
||||
Function Delete-File ([Parameter(ValueFromPipeline=$true)][string]$path) {
|
||||
If ( Test-Path $path ) {
|
||||
If ( !((Get-Item $path) -is [System.IO.DirectoryInfo]) ) {
|
||||
$Global:_FixAteraAgentRestartAgent = $true
|
||||
Try {
|
||||
LogMsg "Delete ""${path}"""
|
||||
Remove-Item $path -Force
|
||||
}
|
||||
Catch { LogErr $_.Exception.Message }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
## Remove cached files related to thresholds and alerts
|
||||
"${Env:PROGRAMFILES}\ATERA Networks\AteraAgent\Packages\AgentPackageMonitoring\AlertsCache.cch",
|
||||
"${Env:PROGRAMFILES}\ATERA Networks\AteraAgent\Packages\AgentPackageMonitoring\AlertsSentCache.cch",
|
||||
"${Env:PROGRAMFILES}\ATERA Networks\AteraAgent\Packages\AgentPackageMonitoring\config.json" | Delete-File
|
||||
|
||||
If ($Global:_FixAteraAgentRestartAgent) {
|
||||
LogMsg "Restarting Atera Agent service"
|
||||
Try { Control-Service -Restart -Name "AteraAgent" -Force }
|
||||
Catch { LogErr $_.Exception.Message }
|
||||
}
|
||||
@@ -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
|
||||
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 }
|
||||
|
||||
## Set installer args
|
||||
If ( $LFHost ) {
|
||||
If (-not [string]::IsNullOrEmpty($LFHost) ) {
|
||||
LogMsg "LiquidFiles target server: ${LFHost}"
|
||||
$INSTALLER_ARGS = "REGKEYSCRIPT=""BaseUrl=${LFHost};"""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user