Compare commits
3
Commits
433e7dcc83
...
8714ddb213
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8714ddb213 | ||
|
|
98571828d8 | ||
|
|
087516fde3 |
@@ -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
|
||||
"${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 }
|
||||
}
|
||||
|
||||
@@ -44,3 +44,7 @@ Catch { LogErr $_.Exception.Message }
|
||||
LogMsg "Setting Emberkom Cloud Backup agent edition to ""$AgentEdition"""
|
||||
Try { Set-MBSAgentSetting -Edition $AgentEdition -Verbose }
|
||||
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 }
|
||||
}
|
||||
|
||||
# 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-LogFile
|
||||
Reference in New Issue
Block a user