Im creating a simple powershell GUI using WPF like this one... WPF GUI to powershell
The problem is that the textbox where i show logs is not being updated while the powershell script is executing some commands. The same function that updates the text of the textbox also logs to standard output, but the messages are shown in the stdout immediately whereas the ones on the textbox are not shown until the end.
$MyTextbox.AddText($LogsLine) -> Not shown until the end
Write-Host ($LogsLine) -> Shown immediately
Is there any way to refresh the textbox after updating its "text" value?
Thanks!
I have tried looking for methods of the textbox or the form itself but i do not find a refresh function.