From 84135b0acbc6da7e27f4f868cd8250598e38168b Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Tue, 2 Jun 2026 14:01:41 -0700 Subject: [PATCH 1/2] Minor fixes to PSScript resource --- resources/PSScript/psscript.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/PSScript/psscript.ps1 b/resources/PSScript/psscript.ps1 index e3d562abb..9af44c38b 100644 --- a/resources/PSScript/psscript.ps1 +++ b/resources/PSScript/psscript.ps1 @@ -154,6 +154,7 @@ try { "Script failed with terminating error: $($ps.InvocationStateInfo.Reason)" } Write-DscTrace -Now -Level Error -Message $message + Write-TraceQueue exit 1 } @@ -162,7 +163,6 @@ try { if ($ps.HadErrors) { - # Errors can be non-terminating, so we just write a warning and continue Write-DscTrace -Now -Level Debug -Message 'Non-terminating errors occurred during script execution.' } From 8f690325d9bfdc5832de1da43a662de1ceaae869 Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Sun, 7 Jun 2026 10:33:05 -0700 Subject: [PATCH 2/2] write trace queue before exit --- resources/PSScript/psscript.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/PSScript/psscript.ps1 b/resources/PSScript/psscript.ps1 index 9af44c38b..48ed86a38 100644 --- a/resources/PSScript/psscript.ps1 +++ b/resources/PSScript/psscript.ps1 @@ -153,8 +153,8 @@ try { } else { "Script failed with terminating error: $($ps.InvocationStateInfo.Reason)" } - Write-DscTrace -Now -Level Error -Message $message Write-TraceQueue + Write-DscTrace -Now -Level Error -Message $message exit 1 } @@ -171,6 +171,7 @@ try { } } catch { + Write-TraceQueue Write-DscTrace -Now -Level Error -Message ($_ | Format-List -Force * | Out-String) exit 1 }