Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8714ddb213 | ||
|
|
98571828d8 | ||
|
|
087516fde3 |
+3
-20
@@ -1,25 +1,8 @@
|
|||||||
$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
|
## Remove cached files related to thresholds and alerts
|
||||||
"${Env:PROGRAMFILES}\ATERA Networks\AteraAgent\Packages\AgentPackageMonitoring\AlertsCache.cch",
|
"${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\AlertsSentCache.cch",
|
||||||
"${Env:PROGRAMFILES}\ATERA Networks\AteraAgent\Packages\AgentPackageMonitoring\config.json" | Delete-File
|
"${Env:PROGRAMFILES}\ATERA Networks\AteraAgent\Packages\AgentPackageMonitoring\config.json" | Delete-File
|
||||||
|
|
||||||
If ($Global:_FixAteraAgentRestartAgent) {
|
LogMsg "Restarting Atera Agent service"
|
||||||
LogMsg "Restarting Atera Agent service"
|
Try { Control-Service -Restart -Name "AteraAgent" -Force }
|
||||||
Try { Control-Service -Restart -Name "AteraAgent" -Force }
|
Catch { LogErr $_.Exception.Message }
|
||||||
Catch { LogErr $_.Exception.Message }
|
|
||||||
}
|
|
||||||
@@ -43,4 +43,8 @@ Catch { LogErr $_.Exception.Message }
|
|||||||
## Note: the product edition must be set *after* the user is added
|
## Note: the product edition must be set *after* the user is added
|
||||||
LogMsg "Setting Emberkom Cloud Backup agent edition to ""$AgentEdition"""
|
LogMsg "Setting Emberkom Cloud Backup agent edition to ""$AgentEdition"""
|
||||||
Try { Set-MBSAgentSetting -Edition $AgentEdition -Verbose }
|
Try { Set-MBSAgentSetting -Edition $AgentEdition -Verbose }
|
||||||
Catch { LogErr $_.Exception.Message }
|
Catch { LogErr $_.Exception.Message }
|
||||||
|
|
||||||
|
## Delete the desktop icon
|
||||||
|
"${Env:PUBLIC}\Desktop\Emberkom Backup.LNK",
|
||||||
|
"${Env:PUBLIC}\Desktop\Emberkom Cloud Backup.LNK" | Remove-File
|
||||||
@@ -512,5 +512,18 @@ function Install-MSP360Module {
|
|||||||
Catch { LogErr $_.Exception.Message }
|
Catch { LogErr $_.Exception.Message }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Function to delete a file
|
||||||
|
function Remove-File ([Parameter(ValueFromPipeline=$true)][string]$path) {
|
||||||
|
If ( Test-Path $path ) {
|
||||||
|
If ( !((Get-Item $path) -is [System.IO.DirectoryInfo]) ) {
|
||||||
|
Try {
|
||||||
|
LogMsg "Delete ""${path}"""
|
||||||
|
Remove-Item $path -Force
|
||||||
|
}
|
||||||
|
Catch { LogErr $_.Exception.Message }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Setup-MSPDirectories
|
Setup-MSPDirectories
|
||||||
Setup-LogFile
|
Setup-LogFile
|
||||||
Reference in New Issue
Block a user