-
Notifications
You must be signed in to change notification settings - Fork 8.4k
WildcardPattern.Escape() does not escape lone backticks correctly #16306
Copy link
Copy link
Closed
Labels
In-PRIndicates that a PR is out for the issueIndicates that a PR is out for the issueIssue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aNeeds-InvestigationThe behavior reported in the issue is unexpected and needs further investigation.The behavior reported in the issue is unexpected and needs further investigation.WG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime
Metadata
Metadata
Assignees
Labels
In-PRIndicates that a PR is out for the issueIndicates that a PR is out for the issueIssue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aNeeds-InvestigationThe behavior reported in the issue is unexpected and needs further investigation.The behavior reported in the issue is unexpected and needs further investigation.WG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime
Type
Fields
Give feedbackNo fields configured for issues without a type.
Prerequisites
Steps to reproduce
WildcardPattern.Escape() does not escape
`, and as a result it's unreliable for escaping input for use in wildcard comparisons:Define a string literal containing a single backtick character:
Create an escaped copy of the string value:
Perform wildcard comparison and observe that it does not yield
$trueas expected:(That is:
[WildcardPattern]::Escape($string)should produce a string value equivalent to'abc``def', not return it as-is)Expected behavior
Actual behavior
Error details
No response
Environment data
Visuals
No response