Skip to content

Select-Object default output formatting is situationally broken #10762

Closed

Description

The test command below should yield:

Length
------
     3

but currently yields:

@{Length=3}

The problem may be specific to [string] input (a rare scenario) - not sure what the underlying pattern is.

Steps to reproduce

'one' | Select-Object Length | Out-String | Should -not -match '@'

Expected behavior

The test should pass.

Actual behavior

The test fails.

Expected regular expression '@' to not match '@{Length=3}
', but it did match.

Environment data

PowerShell Core 7.0.0-preview.4

Activity

  1. added
    Issue-Question
    on Oct 10, 2019
  2. SteveL-MSFT commented on Oct 10, 2019

    @SteveL-MSFT
    Member

    This is a regression from WinPS5.1

  3. added
    Issue-Bug
    and removed
    Issue-Question
    on Oct 10, 2019
  4. iSazonov commented on Oct 10, 2019

    @iSazonov
    Collaborator
     'one' | Select-Object Length
    
    Length
    ------
         3
    
    > $PSVersionTable
    
    Name                           Value
    ----                           -----
    PSVersion                      6.2.3
    PSEdition                      Core
    GitCommitId                    6.2.3
    OS                             Microsoft Windows 10.0.17763
    Platform                       Win32NT
    PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
    PSRemotingProtocolVersion      2.3
    SerializationVersion           1.1.0.1
    WSManStackVersion              3.0
    
  5. SteveL-MSFT commented on Oct 10, 2019

    @SteveL-MSFT
    Member

    Ok, that narrows it down a bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Issue-BugResolution-FixedWG-Cmdlets

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions