make prod ready

This commit is contained in:
2021-10-05 13:42:34 -04:00
parent 641e88bd78
commit e9742704ff
+7 -7
View File
@@ -3,12 +3,12 @@ $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 {
$Global:_FixAteraAgentRestartAgent = $true
# Remove-Item $path -Force
Write-Output "Delete ""${path}"""
LogMsg "Delete ""${path}"""
Remove-Item $path -Force
}
Catch { Write-Error $_.Exception.Message }
Catch { LogErr $_.Exception.Message }
}
}
}
@@ -19,7 +19,7 @@ Function Delete-File ([Parameter(ValueFromPipeline=$true)][string]$path) {
"${Env:PROGRAMFILES}\ATERA Networks\AteraAgent\Packages\AgentPackageMonitoring\config.json" | Delete-File
If ($Global:_FixAteraAgentRestartAgent) {
Write-Output "Restarting Atera Agent service"
Try { Restart-Service -Name "AteraAgent" -Force }
Catch { Write-Error $_.Exception.Message }
LogMsg "Restarting Atera Agent service"
Try { Control-Service -Restart -Name "AteraAgent" -Force }
Catch { LogErr $_.Exception.Message }
}