Fix error swallowing in catch block
Write-Error is suppressed by SilentlyContinue at the top of the script, so failures were silent. Switch to Write-Warning which is always visible. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
d3844a857c
commit
3d0a0d1692
@@ -190,9 +190,7 @@ If (Get-Service $serviceName -ErrorAction SilentlyContinue) {
|
||||
exit 0
|
||||
}
|
||||
Catch {
|
||||
$ErrorMessage = $_.Exception.Message
|
||||
$FailedItem = $_.Exception.ItemName
|
||||
Write-Error -Message "$ErrorMessage $FailedItem"
|
||||
Write-Warning "TacticalRMM install failed: $($_.Exception.Message)"
|
||||
exit 1
|
||||
}
|
||||
Finally {
|
||||
|
||||
Reference in New Issue
Block a user