Skip to content

Commit d469b31

Browse files
committed
Correct PowerShell loader diagnostics guidance
1 parent b37f28d commit d469b31

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

  • content/articles/2026/09/run-powershell-data-loaders-on-azure-static-web-apps

‎content/articles/2026/09/run-powershell-data-loaders-on-azure-static-web-apps/index.md‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,11 @@ $movies |
6969

7070
The script retrieves JSON, selects the columns needed by the page, and writes CSV to
7171
standard output. That last detail is important: standard output becomes the generated
72-
file. Send diagnostics to the information, warning, or error streams so they do not
73-
corrupt the CSV.
72+
file. When `pwsh` runs as an external process, PowerShell's information, warning,
73+
verbose, and debug streams are also written to standard output, so using them can
74+
corrupt the CSV. Write non-fatal diagnostics directly to standard error, for example
75+
with `[Console]::Error.WriteLine('message')`, and use `throw` when the loader should
76+
fail.
7477

7578
You can test the loader independently:
7679

0 commit comments

Comments
 (0)