Skip to content

Commit

Permalink
(GH-10592) Clarify culture impact for comparison operators
Browse files Browse the repository at this point in the history
Prior to this change, the _about_Comparison_Operators_ article noted
that the comparisons use InvariantCulture, but not how that affects
the expected output for the comparisons.

This change:

- Extends the explanation, clarifying that the results are the same
  regardless of current culture
- Resolves #10592
- Fixes AB#176660
  • Loading branch information
michaeltlombardi committed Oct 30, 2023
1 parent ece5abc commit 09e4cf2
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
description: Describes the operators that compare values in PowerShell.
Locale: en-US
ms.date: 08/17/2023
ms.date: 10/30/2023
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comparison_operators?view=powershell-5.1&WT.mc_id=ps-gethelp
schema: 2.0.0
title: about Comparison Operators
Expand Down Expand Up @@ -61,7 +61,9 @@ To make the case-insensitivity explicit, add an `i` after `-`. For example,
`-ieq` is the explicitly case-insensitive version of `-eq`.

String comparisons use the [InvariantCulture][01] for both case-sensitive and
case-insensitive comparisons.
case-insensitive comparisons. The comparisons are between unicode code points
and don't use culture-specific collation ordering. The results are the same
regardless of the current culture.

When the input of an operator is a scalar value, the operator returns a
**Boolean** value. When the input is a collection, the operator returns the
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
description: Describes the operators that compare values in PowerShell.
Locale: en-US
ms.date: 08/17/2023
ms.date: 10/30/2023
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comparison_operators?view=powershell-7.2&WT.mc_id=ps-gethelp
schema: 2.0.0
title: about Comparison Operators
Expand Down Expand Up @@ -61,7 +61,9 @@ To make the case-insensitivity explicit, add an `i` after `-`. For example,
`-ieq` is the explicitly case-insensitive version of `-eq`.

String comparisons use the [InvariantCulture][01] for both case-sensitive and
case-insensitive comparisons.
case-insensitive comparisons. The comparisons are between unicode code points
and don't use culture-specific collation ordering. The results are the same
regardless of the current culture.

When the input of an operator is a scalar value, the operator returns a
**Boolean** value. When the input is a collection, the operator returns the
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
description: Describes the operators that compare values in PowerShell.
Locale: en-US
ms.date: 08/17/2023
ms.date: 10/30/2023
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comparison_operators?view=powershell-7.3&WT.mc_id=ps-gethelp
schema: 2.0.0
title: about Comparison Operators
Expand Down Expand Up @@ -61,7 +61,9 @@ To make the case-insensitivity explicit, add an `i` after `-`. For example,
`-ieq` is the explicitly case-insensitive version of `-eq`.

String comparisons use the [InvariantCulture][01] for both case-sensitive and
case-insensitive comparisons.
case-insensitive comparisons. The comparisons are between unicode code points
and don't use culture-specific collation ordering. The results are the same
regardless of the current culture.

When the input of an operator is a scalar value, the operator returns a
**Boolean** value. When the input is a collection, the operator returns the
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
description: Describes the operators that compare values in PowerShell.
Locale: en-US
ms.date: 08/17/2023
ms.date: 10/30/2023
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comparison_operators?view=powershell-7.4&WT.mc_id=ps-gethelp
schema: 2.0.0
title: about Comparison Operators
Expand Down Expand Up @@ -61,7 +61,9 @@ To make the case-insensitivity explicit, add an `i` after `-`. For example,
`-ieq` is the explicitly case-insensitive version of `-eq`.

String comparisons use the [InvariantCulture][01] for both case-sensitive and
case-insensitive comparisons.
case-insensitive comparisons. The comparisons are between unicode code points
and don't use culture-specific collation ordering. The results are the same
regardless of the current culture.

When the input of an operator is a scalar value, the operator returns a
**Boolean** value. When the input is a collection, the operator returns the
Expand Down

0 comments on commit 09e4cf2

Please sign in to comment.