Skip to content

allow pscustomobject to have property with empty string name - #5129

Closed
Steve Lee (SteveL-MSFT) wants to merge 2 commits into
PowerShell:masterfrom
SteveL-MSFT:json-emptystring
Closed

Steve Lee (SteveL-MSFT) wants to merge 2 commits into
PowerShell:masterfrom
SteveL-MSFT:json-emptystring

Conversation

@SteveL-MSFT

Copy link
Copy Markdown
Member

Needed to allow convertfrom-json to support json objects that have empty string property names which apparently is used pretty often

Fix #1755

@PetSerAl

Copy link
Copy Markdown
Contributor

How about ForEach-Object -MemberName '' or Add-Member -Name ''?

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

PetSerAl great point, will update: ForEach-Object and *-Member cmdlets

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

For now, I'm only going to add support for Get-Member and not Add-Member as we don't want to promote creation of members with empty string names.

cleaned up formatting in Get-Member.Tests.ps1
@lzybkr

Copy link
Copy Markdown
Contributor

We considered this before and rejected it, see #2820

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

Completely forgot about that discussion almost a year ago. This is unfortunately not going to make it into 6.0.0 and we'll have to revisit in 6.1.0

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

Labels

Breaking-Change breaking change that may affect users

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants