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:
1 parent
d3844a857c
commit
3d0a0d1692
1 file changed
+1
-3
@@ -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