major change to override Write-Error func

This commit is contained in:
2023-10-05 13:17:18 -04:00
parent bbb4884818
commit 5f4b4565de
42 changed files with 114 additions and 114 deletions
+2 -2
View File
@@ -11,7 +11,7 @@ Stop-Service -Name 'AteraAgent' -Force
If ( Test-Path $FolderNewName ) {
Write-Output "Deleting previously renamed folder: ${FolderNewName}"
Try { Remove-Item $FolderNewName -Recurse -Force }
Catch { LogErr $_.Exception.Message }
Catch { Write-Error $_.Exception.Message }
}
Write-Output "Stopping AgentPackageMonitoring process"
@@ -19,7 +19,7 @@ Get-Process -Name "AgentPackageMonitoring" -ErrorAction SilentlyContinue | Stop-
Write-Output "Renaming ${FolderToRename}"
Try { Rename-Item $FolderToRename $FolderNewName -Force }
Catch { LogErr $_.Exception.Message }
Catch { Write-Error $_.Exception.Message }
Write-Output "Starting Atera agent"
Start-Service -Name 'AteraAgent'