Powershell Tip #134: Out-GridView with PassThru parameter

By | September 15, 2018

Tip: You can use the PassThru parameter to send the selected items from the window down the pipeline with the Out-GridView cmdlet.

In other words, with the PassThru parameter the GUI window will get two buttons : OK and Cancel.

Without -PassThru

With -PassThru

If you select the calc.exe line and press Ctrl key to select also mspaint.exe, when you click OK both processes will be stopped.

The parameter -PassThru can be useful to select multiple items and perform on action on them.


Leave a Reply

Your email address will not be published.