What I have:
Process.Start("powershell.exe", "-executionpolicy remotesigned -file C:\temp\test.ps1")
Do Until (ready = True)
If Process.GetProcessesByName("powershell").Length <> 0 Then
ready = False
Else
ready = True
End If
Loop
... more code ...
Currently my program freezes while powershell is active. If the powershell script takes too long time, more then 60 seconds, my program also crashes. How finally make it smooth, like using a timer so that it does not freeze anymore.
EDIT:
Finally I'd like to check every 5 seconds if powershell is active.
EDIT 2:
I can just do
Dim test As Process = Process.Start("powershell.exe", "-executionpolicy
remotesigned -file C:\temp\test.ps1")
test.WaitForExit()
And it does not crashes anymore, but it still freezes :/