Skip to content

Provide details about changing default for comparison operators case sensitivity #8828

@agr

Description

@agr

Prerequisites

  • Write a descriptive title.
  • Search the existing issues.
  • I am reporting the documentation problem for version of PowerShell I am using.

Version

5.1, 7.0, 7.1

Link to affected document

https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_comparison_operators?view=powershell-7.2#common-features

Description of the documentation error

Common features section starts with the following sentence:

By default, string comparisons are case-insensitive.

This seem to imply that there is a way to change the case-sensitivity behavior for, say, -eq operator.

Moreover, Powershell language specification 3.0 section 7.8.1 states:

For two strings to compare equal, they must have the same length and contents, and letter case, if appropriate.

Which, if I read that correctly, requires case sensitive comparisons.

Suggested fix

Either provide details regarding how to make string comparisons case-sensitive or rephrase to remove the ambiguity.

Not sure what to do about spec, but it seems it is pretty old and maybe irrelevant at this point.

Metadata

Metadata

Assignees

Labels

area-aboutArea - About_ topicsissue-doc-bugIssue - error in documentationresolution-answeredStatus - closed by existing documentation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions