Determine Which Parameters Support Pipeline Input

A question that I had recently was how can a user determine which parameters have support for pipeline input in a cmdlet.

The answer lies within the help system of PowerShell. Using the –Parameter parameter of Get-Help, you can view information about whatever parameters you want to see.

Get-Help Get-Process -Parameter Computername

image

Here you can see that it does allow for pipeline input under the Computername parameter in Get-Process. What you may not know is that this is an object that you can explore.

Get-Help Get-Process -Parameter Computername | Get-Member

image

Note that the pipelineInput property is a string value, not a boolean even though it does return False and True (with caveats). This doesn’t make finding the parameters with pipeline support any more difficult as we can easily filter for the true values.

Get-Help Get-Process -Parameter * | Where {
    $_.pipelineInput -Like 'true*'
} | Select Name, PipelineInput

image

As you can see, we are able to see all of the parameters of Get-Process which has support for pipeline input. Now you can more easily determine which cmdlets have parameters that have pipeline support.

About Boe Prox

Microsoft Cloud and Datacenter MVP working as a SQL DBA.
This entry was posted in powershell and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s