Skip to content

Commit

Permalink
Add note about comparing collections
Browse files Browse the repository at this point in the history
  • Loading branch information
sdwheeler committed Jun 6, 2024
1 parent 36128b0 commit 5e59171
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 16 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: 01/19/2024
ms.date: 06/06/2024
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 @@ -65,9 +65,13 @@ 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][15] value, the operator returns a
**Boolean** value. When the input is a collection, the operator returns the
elements of the collection that match the right-hand value of the expression.
When the left-hand value in the comparison expression is a [scalar][15] value,
the operator returns a **Boolean** value. When the left-hand value in the
expression is a collection, the operator returns the elements of the collection
that match the right-hand value of the expression. Right-hand values are always
treated as singleton instances, even when they're collections. The comparison
operators can't effectively compare collections to collections.

If there are no matches in the collection, comparison operators return an empty
array. For example:

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: 01/19/2024
ms.date: 06/06/2024
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 @@ -65,9 +65,13 @@ 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][15] value, the operator returns a
**Boolean** value. When the input is a collection, the operator returns the
elements of the collection that match the right-hand value of the expression.
When the left-hand value in the comparison expression is a [scalar][15] value,
the operator returns a **Boolean** value. When the left-hand value in the
expression is a collection, the operator returns the elements of the collection
that match the right-hand value of the expression. Right-hand values are always
treated as singleton instances, even when they're collections. The comparison
operators can't effectively compare collections to collections.

If there are no matches in the collection, comparison operators return an empty
array. For example:

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: 01/19/2024
ms.date: 06/06/2024
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 @@ -65,9 +65,13 @@ 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][15] value, the operator returns a
**Boolean** value. When the input is a collection, the operator returns the
elements of the collection that match the right-hand value of the expression.
When the left-hand value in the comparison expression is a [scalar][15] value,
the operator returns a **Boolean** value. When the left-hand value in the
expression is a collection, the operator returns the elements of the collection
that match the right-hand value of the expression. Right-hand values are always
treated as singleton instances, even when they're collections. The comparison
operators can't effectively compare collections to collections.

If there are no matches in the collection, comparison operators return an empty
array. For example:

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: 01/19/2024
ms.date: 06/06/2024
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comparison_operators?view=powershell-7.5&WT.mc_id=ps-gethelp
schema: 2.0.0
title: about Comparison Operators
Expand Down Expand Up @@ -65,9 +65,13 @@ 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][15] value, the operator returns a
**Boolean** value. When the input is a collection, the operator returns the
elements of the collection that match the right-hand value of the expression.
When the left-hand value in the comparison expression is a [scalar][15] value,
the operator returns a **Boolean** value. When the left-hand value in the
expression is a collection, the operator returns the elements of the collection
that match the right-hand value of the expression. Right-hand values are always
treated as singleton instances, even when they're collections. The comparison
operators can't effectively compare collections to collections.

If there are no matches in the collection, comparison operators return an empty
array. For example:

Expand Down

0 comments on commit 5e59171

Please sign in to comment.