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.


previous-buttonnext-button

2 thoughts on “Powershell Tip #134: Out-GridView with PassThru parameter

  1. Pingback: Powershell Tip #133: Set a title to Out-GridView window | Powershell Guru

  2. Pingback: Powershell Tip #135: Read file as a byte array | Powershell Guru

Leave a Reply

Your email address will not be published. Required fields are marked *