Skip to content

Select-Object -InputObject not work compared to pipeline input #26923

@PtJade-Ceramic

Description

@PtJade-Ceramic

Prerequisites

Steps to reproduce

I am experiencing a problem with Select-Object 's parameter -InputObject.

I think its output should be the same as that responding to the value from the pipeline.

However it echos an empty set only.

Expected behavior

PS> Get-Member -InputObject (Get-Help Get-Help) | Select-Object MemberType -Unique

  MemberType
  ----------
      Method
NoteProperty

Actual behavior

PS> Select-Object -InputObject (Get-Help Get-Help | Get-Member) MemberType -Unique

MemberType
----------

Error details

Environment data

PS> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.6.0-rc.1
PSEdition                      Core
GitCommitId                    7.6.0-rc.1
OS                             Microsoft Windows 10.0.26200
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.4
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

PS> $PSVersionTable.PSVersion

Major  Minor  Patch  PreReleaseLabel BuildLabel
-----  -----  -----  --------------- ----------
7      6      0      rc.1

Visuals

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions