I'm searching how I could check if a winform form is opened with Powershell, like this response for VB.net. I'm working with two runspaces, and I need to start the second, when my form is opened.
My first runspace is for the GUI. When the UI creation is completed, I opened it
$CommonHashTable.MainForm.ShowDialog()
And then, I'm trying to test if this form is opened (snipet from VB.net) from PowerShell main thread:
If Application.OpenForms().OfType(Of $CommonHashTable.MainForm).Any Then
... startsecondrunspace