Prerequisites
Steps to reproduce
The -Property parameter (conveniently) interprets its arguments as wildcard expressions, so that 'foo' | Select-Object Len* select the .Length property, for instance.
While perhaps a rare scenario, user may want to select properties that literally contain a * character (see this Stack Overflow question for an example).
While escaping the * as `* is effective in bypassing the wildcard matching, the ` char. is inappropriately retained as part of the resulting property name.
Note:
-
If there's a performance concern with respect to correcting this behavior, the pitfall should at least be documented.
-
The workaround is to use a calculated property (see linked Stack Overflow post).
'foo' | Select Len*, 'Bar`*'
Expected behavior
Length Bar*
------ -----
3
Actual behavior
Length Bar`*
------ -----
3
That is, the ` was unexpectedly retained as part of the property name.
Error details
No response
Environment data
PowerShell Core 7.3.0-preview.3
Visuals
No response
Prerequisites
Steps to reproduce
The
-Propertyparameter (conveniently) interprets its arguments as wildcard expressions, so that'foo' | Select-Object Len*select the.Lengthproperty, for instance.While perhaps a rare scenario, user may want to select properties that literally contain a
*character (see this Stack Overflow question for an example).While escaping the
*as`*is effective in bypassing the wildcard matching, the`char. is inappropriately retained as part of the resulting property name.Note:
If there's a performance concern with respect to correcting this behavior, the pitfall should at least be documented.
The workaround is to use a calculated property (see linked Stack Overflow post).
Expected behavior
Actual behavior
That is, the
`was unexpectedly retained as part of the property name.Error details
No response
Environment data
Visuals
No response