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.
1 |
Get-Process | Out-GridView -PassThru | Stop-Process |
The parameter -PassThru can be useful to select multiple items and perform on action on them.