New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The .ForEach() array method misbehaves with XmlElement instances if the name of the property to extract is passed as a string #15994
Comments
Just a guess but it looks like the
|
@rkeithhill, note that The problem here, as demonstrated in the OP, is that the single output object is itself an array ( |
Ah, yup. |
I dug a little under the debugger and here are what I found:
This is why single output object is itself an array. |
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you. |
2 similar comments
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you. |
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you. |
This issue has been marked as "No Activity" as there has been no activity for 6 months. It has been closed for housekeeping purposes. |
Prerequisites
Steps to reproduce
The forms
$collection.ForEach('someProp')
and$collection.ForEach({ $_.someProp })
should be equivalent and generally are (the former being faster).However, with an (adapted)
XmlElement
enumerating the child elements with.ForEach('someProp')
does not work as expected: it returns the child elements as an array in the first element of the returned collection.Expected behavior
Actual behavior
Error details
No response
Environment data
Visuals
No response
The text was updated successfully, but these errors were encountered: