You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With string operands, PowerShell's -eq operator (and its inverse, -ne), performs case-insensitive, culture-invariant string comparison (StringComparison.InvariantCultureIgnoreCase).
As of .NET 5.0, the runtime underlying PowerShell 7.1, this method appears to ignore non-printing control characters. Earlier versions, including up to (at least) 3.1.2 (underlying PowerShell 7.0.5) and the .NET Framework version underlying Windows PowerShell do not.
For instance:
# Escape sequence "`a" is [char] 7'Food'-eq"Foo`ad"# !! $true in .NET 5+ - the non-printing control character is *ignored*
Prerequisites
Summary of the new feature or changed behavior
With string operands, PowerShell's
-eq
operator (and its inverse,-ne
), performs case-insensitive, culture-invariant string comparison (StringComparison.InvariantCultureIgnoreCase).As of .NET 5.0, the runtime underlying PowerShell 7.1, this method appears to ignore non-printing control characters. Earlier versions, including up to (at least) 3.1.2 (underlying PowerShell 7.0.5) and the .NET Framework version underlying Windows PowerShell do not.
For instance:
List of articles that need to be updated
Link to related PR in PowerShell/PowerShell repo
n/a
Link to related Issues in PowerShell/PowerShell repo
PowerShell/PowerShell#14956 (comment)
The text was updated successfully, but these errors were encountered: