December 14th, 2014

PowerTip: Cause Out-GridView Cmdlet to Pause

Doctor Scripto
Scripter

Summary: Use Windows PowerShell to pause the script while the Out-GridView displays.

Hey, Scripting Guy! Question How can I pause the execution of my Windows PowerShell script while the Out-GridView cmdlet displays a grid view?
           (I do not need to pass information from the grid to the script.)

Hey, Scripting Guy! Answer The –Wait parameter from the Out-GridView cmdlet will pause script execution while the grid displays.
           Here is an example:

Get-Process | select name, id | Out-GridView -Wait

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.