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) {
|
Function Delete-File ([Parameter(ValueFromPipeline=$true)][string]$path) {
|
||||||
If ( Test-Path $path ) {
|
If ( Test-Path $path ) {
|
||||||
If ( !((Get-Item $path) -is [System.IO.DirectoryInfo]) ) {
|
If ( !((Get-Item $path) -is [System.IO.DirectoryInfo]) ) {
|
||||||
|
$Global:_FixAteraAgentRestartAgent = $true
|
||||||
Try {
|
Try {
|
||||||
$Global:_FixAteraAgentRestartAgent = $true
|
LogMsg "Delete ""${path}"""
|
||||||
# Remove-Item $path -Force
|
Remove-Item $path -Force
|
||||||
Write-Output "Delete ""${path}"""
|
|
||||||
}
|
}
|
||||||
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
|
"${Env:PROGRAMFILES}\ATERA Networks\AteraAgent\Packages\AgentPackageMonitoring\config.json" | Delete-File
|
||||||
|
|
||||||
If ($Global:_FixAteraAgentRestartAgent) {
|
If ($Global:_FixAteraAgentRestartAgent) {
|
||||||
Write-Output "Restarting Atera Agent service"
|
LogMsg "Restarting Atera Agent service"
|
||||||
Try { Restart-Service -Name "AteraAgent" -Force }
|
Try { Control-Service -Restart -Name "AteraAgent" -Force }
|
||||||
Catch { Write-Error $_.Exception.Message }
|
Catch { LogErr $_.Exception.Message }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user