Skip to content

[7.2 Preview 9] Add-Member to a string and converting to JSON produces a different result than 7.1 #16069

@JustinGrote

Description

@JustinGrote

Prerequisites

Steps to reproduce

'test' | add-member 'newmember' 'test' -passthru | convertto-json

Expected behavior

{
  "value": "test",
  "newmember": "test"
}

Actual behavior

"test"

Error details

No response

Environment data

Name                           Value
----                           -----
PSVersion                      7.2.0-preview.9
PSEdition                      Core
GitCommitId                    7.2.0-preview.9
OS                             Microsoft Windows 10.0.22000
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-AnsweredThe question is answered.WG-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