Hello all,
I have a gui with a RUN button. Behind the button is the code
$global:results = .\powershellscript.ps1
$global:results | out-gridview
The grid displays for about 2 seconds then it and the form closes and I have no idea why ?
Thoughts ?
Thanks
GUI closing after script run
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: GUI closing after script run
Please refer to this article as to why the form might be closing:
https://www.sapien.com/blog/2015/06/29/ ... e-my-form/
As for Out-GridView, you might want to use the -Wait parameter to hold the pipeline, otherwise the cmdlet will return immediately.
https://www.sapien.com/blog/2015/06/29/ ... e-my-form/
As for Out-GridView, you might want to use the -Wait parameter to hold the pipeline, otherwise the cmdlet will return immediately.
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.