MicrosoftDocs / windows-powershell-docs

This repo is used to contribute to Windows 10, Windows Server 2016, and MDOP PowerShell module documentation.
Creative Commons Attribution 4.0 International
444 stars 591 forks source link

Pipeline termination when using Select -First 1 #1722

Closed eponerine closed 4 years ago

eponerine commented 4 years ago

Let's do something simple, like grabbing a single node of our cluster:

Get-ClusterNode | Select -First 1

You end up with the following pipeline errors:

Name        State Type
----        ----- ----
NODE-01     Up    Node
Get-ClusterNode : The pipeline has been stopped.
    + CategoryInfo          : NotSpecified: (:) [Get-ClusterNode], ClusterCmdletException
    + FullyQualifiedErrorId : Get-ClusterNode,Microsoft.FailoverClusters.PowerShell.GetNodeCommand
Get-ClusterNode : The pipeline has been stopped.
    + CategoryInfo          : NotSpecified: (:) [Get-ClusterNode], ClusterCmdletException
    + FullyQualifiedErrorId : Get-ClusterNode,Microsoft.FailoverClusters.PowerShell.GetNodeCommand
Get-ClusterNode : The pipeline has been stopped.
    + CategoryInfo          : NotSpecified: (:) [Get-ClusterNode], ClusterCmdletException
    + FullyQualifiedErrorId : Get-ClusterNode,Microsoft.FailoverClusters.PowerShell.GetNodeCommand
Get-ClusterNode : The pipeline has been stopped.
    + CategoryInfo          : NotSpecified: (:) [Get-ClusterNode], ClusterCmdletException
    + FullyQualifiedErrorId : Get-ClusterNode,Microsoft.FailoverClusters.PowerShell.GetNodeCommand

It appears that this is an issue with a lot of the Failover Clustering cmdlets. Try it with other FCM commands!


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

eponerine commented 4 years ago

It looks like if you wrap the Clustering cmdlets in parens, and then pipe, it works. This is still really horrible behavior.

o0nj commented 4 years ago

It seems that this question can best be answered via PowerShell Community Links

For bug reports specific to PowerShell, please visit, PowerShell at GitHub.

The issues section of this repository is for content fixes regarding documentation. Feel free to re-open in case you would like to suggest improvements to the article itself.

Thank you.