make prod ready
This commit is contained in:
+7
-7
@@ -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 }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user