PowerShell PassThru and OutputMode

14 Sep

So I’m probably a bit late to the party on this one, but as I’m brushing up on my PowerShell tekkers, I came across the -PassThru and -OutputMode parameters, available in PS3.

In short, you can output a query to a GridView, make selections from this GUI and then pass these selections back to PowerShell to perform further actions.

For example:

This returns a list of all Office 365 mailboxes. I can then select a mailboxe and run PowerShell based on this. In this case, I just return some more information, but this could just as easily be a Set-Mailbox command or similar.

The following just allows multiple items to be selected, by using the CTRL key:

Pretty awesome.