PowerShell Form Running Detached RRS feed

  • Question

  • Hello,

    I'm developing a Windows based form from PowerShell, and i'm struggling with interaction with the main HostUI form, when on of the actions on the form has been selected.

    In essence, when you click on a button on my form, it fires up a separate PS and calls a script to do some stuff, however whilst that second window remains open, i still want the buttons on the original form to be active. Currently i can only use the buttons again once i've closed the new PS window.

    My question, how can i invoke or call this in a somewhat disconnected state, so both windows are still interactive?

    I've tried adding &, and calling the -InDisconnectedSession but i'm not getting any joy.

    invoke-expression 'cmd /c start powershell -noexit -inputformat text -outputformat text -Command { c:\script\ConnectUP.ps1 }'

    Any help would be very much appreciated.


    Wednesday, June 5, 2019 12:41 PM

All replies