Skip to content

Select-Object -ExpandProperty does not work with Hashtable members #11094

@TobiasPSP

Description

@TobiasPSP

Select-Object reports an error when -ExpandProperty is used on a hashtable member that is not a key.

Version:
PowerShell 7 Preview 5

Reproduce:
$PSVersionTable | Select-Object -expandProperty Keys

Expected Result:
[list of hashtable keys]

Actual Result:
Exception:
Select-Object: Property "count" cannot be found.

Workaround:
$PSVersionTable | ForEach-Object { $_.Keys }

Details:
https://powershell.one/bugs/powershell-7/select-object

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-BugIssue has been identified as a bug in the productWG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions