06 January 2015

Out-GridView enhancement in powershell v3

In powershell v3 cmdlet Out-GridView had a great enhancement with OutputMode parameter.

When used, this parameter instructs the cmdlet to send the items from the interactive window down the pipeline as input to another command.

By default, this cmdlet does not generate any output bat by using this OutputMode parameter, the user can select one or more items that will be send down the pipeline.

OutputMode can be set to:

  • None - no items.
  • Single - zero or one item can be selected.
  • Multiple - zero, one or more items can be selected to be send down the pipeline to the next cmdlet.
Example (will try to stop selected processes):

Get-Process | Out-GridView -OutputMode Multiple | Stop-Process

No comments:

Post a Comment