I have a Powershell GUI, and there are a couple of Checkboxes the user can click ,a Button and a TextBox. If the button is clicked the functions starts working and does a lot of copying renaming etc...
When each "section" is done (like copying a .zip file) I Append a to the Textbox, heres how my program looks like:
$button.Add_Click({Test})
function Test{
"some zip copying code"
$TextBox.AppendText("'r'n ZIP file copied...")
"some renaming code"
$TextBox.AppendText("'r'n File succesfully renamed..")
}
If i press the button the whole program freezes and if done, it prints all "messages" at once. How can i do a threding in it so that the program wont freeze, and when a section is done, it prints to the textbox?