first, I have been playing with powershell for some time BUT I'm no programmer, so please keep that in mind There are 2 way my script ends, 1 - I click on the Form's Stop Button All works fine, the Form closed and the second Job (robocopy) gets stopped all Good 2 - the Robocopy job ends then I need to close\stop the Form, the Stop-job\Remove-Job (with the -force option) work BUT there is a very Long delay as it stops the still "Running" Form job that is waiting for a key\button press
can anyone help
a stated the stop-job works but there is a very long delay, I have even been able to get the PID of the Form job and kill that (taskkill /f /pid) the Form window closes, but the get-job still show the Job state as "running" and Stop-job still have a very Long delay !!