That was going to be my suggestion for getting it out of the WinForms context – either that, or launching the command in a job, which you can then check the status of. The WinForms stuff is a little janky. Sort of the more "forward looking" approach would be to have a jump server with a custom endpoint that you could call into from the form, so the form isn't actually running anything, but it sound slike that might not be an option here.
↧