I have a powershell script which includes a 'WriteToLog' function which basically just writes data to the output stream using the 'Write-Output' cmdlet. This used to work without any issue, however I have since introduced a custom form which is built by the script and displayed using the 'ShowDialog' cmdlet - once the form is displayed any calls to the 'WriteToLog' function do not seem to work any more?
Note: I have proven that the form is calling the 'WriteToLog' function successfully, but the 'Write-Output' is no longer working as expected. I reckon this is because the output is being sent to the output stream of the form and not the calling script but this is a complete guess.
So any ideas how I can dynamically get the output from a generated form in Powershell.
I assume this is because the