Prerequisites
Steps to reproduce
Follow-up to #25509, which was inappropriately closed as by design (also related: #17068):
[PSCustomObject]@{ 'Foo[]' = 'bar' } | Select-Object Foo*, ([WildcardPattern]::Escape('Foo[]'))
Expected behavior
Foo[] Foo[]
----- -------
bar bar
Note: Strictly speaking, targeting the same property twice would result in an error, but the above is meant to illustrate that both approaches to targeting the property literally named Foo[] should succeed.
Actual behavior
Foo[] Foo`[`]
----- -------
bar
That is, the Foo[] property cannot be targeted by its full name, even with proper escaping; the column header suggests that the escaped name is mistakenly used verbatim to look for a property by that name (and therefore creates a property by this mistaken name).
(Ditto with -ExpandProperty, where the error message indicates the same thing.)
Error details
Environment data
PowerShell 7.6.0-preview.4
Visuals
No response
Prerequisites
Steps to reproduce
Follow-up to #25509, which was inappropriately closed as by design (also related: #17068):
Expected behavior
Note: Strictly speaking, targeting the same property twice would result in an error, but the above is meant to illustrate that both approaches to targeting the property literally named
Foo[]should succeed.Actual behavior
That is, the
Foo[]property cannot be targeted by its full name, even with proper escaping; the column header suggests that the escaped name is mistakenly used verbatim to look for a property by that name (and therefore creates a property by this mistaken name).(Ditto with
-ExpandProperty, where the error message indicates the same thing.)Error details
Environment data
Visuals
No response