Consider the following PowerShell commands around failover clustering:

Get-ClusterGroup "UKMAC-XA54" | Get-ClusterResource

The first cmdlet returns a single ClusterGroup object with the fields Name, OwnerNode & State.

Get-ClusterResource, if left to it's own devices, would return information about all resources in the cluster.

However, when used in the pipeline, there is obviously some filtering going on.

My question is "How does this filtering work?". How does PowerShell know to use the OwnerNode field from Get-ClusterGroup to filter Get-ClusterResource? There is a "Name" field return in both cmdlets, why doesn't it filter on "Name"? (which wouldn't actually work).

A link to a reference on this subject would be great.


The piped objects (the one/ones returned by the Get-ClusterGroup call) will be passed as -InputObject to the Get-ClusterResource cmdlet. You can see this if you read the help on the -InputObject parameter, where it states that the parameter accepts pipeline input (by value).

The documentation on the -InputObject parameter further states that it "Specifies the cluster node or cluster group to enumerate cluster resources on." Which means that the filtering is done based on the objects passed into this parameter.

I suggest reading the help section on how the pipeline works, which you can get it you run:

Get-Help about_Pipelines

And you can read detailed help on your Get-ClusterResource cmdlet, to see which parameters accepts pipeline input (and whether they accept it by value or by name, which you can read more about in the help section about pipelines) if your run:

Get-Help Get-ClusterResource -Full

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.