I have a script that presents results using out-gridview
. Here is a simple example:
"hello world" | out-gridview
When I run the script using Run with PowerShell, it will open gridview and close it immediately after it is opened. (I think this is because gridview is not modal and the script finishes.)
How to make the PowerShell wait until the gridview is manually closed?
How about:
"hello world" | out-gridview -wait
According to the documentation of Out-GridView
, the option -Wait
prevents Windows PowerShell from closing until the Out-GridView window is closed.
It is available in Windows PowerShell 3.0.
Just add -PassThru
to the Out-Gridview - adds an "OK" and "Cancel" button to the gridview - now you can "run with powershell" and close the gridview window using the OK button when you are done - soooo much more straightforward!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With