You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When inside one of the script blocks, something will be written to the console, then this is also captured. Initially it sounds reasonable but there is a danger here.
The Write-Error "An error message" will be captured by onWriteErrorBlock and written to the host as [OnWriteError] An error message which in turn will be captured by onWriteOutputBlock and written to the host as [OnWriteError] [OnWriteError] An error message. This flow is recursive.
The danger here is not only with the error or output but also with debug. Imagine using in the OnWriteDebug block a cmdlet that outputs debug messages.
The module is very cool but have you considered this flow?
The text was updated successfully, but these errors were encountered:
When inside one of the script blocks, something will be written to the console, then this is also captured. Initially it sounds reasonable but there is a danger here.
The
Write-Error "An error message"
will be captured byonWriteErrorBlock
and written to the host as[OnWriteError] An error message
which in turn will be captured byonWriteOutputBlock
and written to the host as[OnWriteError] [OnWriteError] An error message
. This flow is recursive.The danger here is not only with the error or output but also with debug. Imagine using in the
OnWriteDebug
block a cmdlet that outputs debug messages.The module is very cool but have you considered this flow?
The text was updated successfully, but these errors were encountered: