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
|
exit 0
|
||||||
}
|
}
|
||||||
Catch {
|
Catch {
|
||||||
$ErrorMessage = $_.Exception.Message
|
Write-Warning "TacticalRMM install failed: $($_.Exception.Message)"
|
||||||
$FailedItem = $_.Exception.ItemName
|
|
||||||
Write-Error -Message "$ErrorMessage $FailedItem"
|
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
Finally {
|
Finally {
|
||||||
|
|||||||
Reference in New Issue
Block a user