From 0fc9c885e1c98fb8fbe9354f77c450e2274ea26f Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Thu, 2 Apr 2026 15:15:38 -0500 Subject: [PATCH] Explain multiple pattern scenario --- reference/5.1/Microsoft.PowerShell.Utility/Select-String.md | 6 ++++-- reference/7.4/Microsoft.PowerShell.Utility/Select-String.md | 6 ++++-- reference/7.5/Microsoft.PowerShell.Utility/Select-String.md | 6 ++++-- reference/7.6/Microsoft.PowerShell.Utility/Select-String.md | 6 ++++-- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Select-String.md b/reference/5.1/Microsoft.PowerShell.Utility/Select-String.md index 7904e81e6588..0142368b340d 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Select-String.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Select-String.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 06/07/2024 +ms.date: 04/02/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/select-string?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 aliases: @@ -598,7 +598,9 @@ Accept wildcard characters: True ### -Pattern -Specifies the text to find on each line. The pattern value is treated as a regular expression. +Specifies the text to find on each line. The pattern value is treated as a regular expression. The +parameter accepts multiple patterns in an array. If you specify more than one pattern, +`Select-String` returns matches for each pattern. To learn about regular expressions, see [about_Regular_Expressions](../Microsoft.PowerShell.Core/About/about_Regular_Expressions.md). diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Select-String.md b/reference/7.4/Microsoft.PowerShell.Utility/Select-String.md index fd9fbf7a783a..0270b1833935 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Select-String.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Select-String.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 11/05/2025 +ms.date: 04/02/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/select-string?view=powershell-7.4&WT.mc_id=ps-gethelp schema: 2.0.0 aliases: @@ -706,7 +706,9 @@ Accept wildcard characters: True ### -Pattern -Specifies the text to find on each line. The pattern value is treated as a regular expression. +Specifies the text to find on each line. The pattern value is treated as a regular expression. The +parameter accepts multiple patterns in an array. If you specify more than one pattern, +`Select-String` returns matches for each pattern. To learn about regular expressions, see [about_Regular_Expressions](../Microsoft.PowerShell.Core/About/about_Regular_Expressions.md). diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Select-String.md b/reference/7.5/Microsoft.PowerShell.Utility/Select-String.md index 0f1ea367221d..fba6ad9e8480 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Select-String.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Select-String.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 11/05/2025 +ms.date: 04/02/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/select-string?view=powershell-7.5&WT.mc_id=ps-gethelp schema: 2.0.0 aliases: @@ -706,7 +706,9 @@ Accept wildcard characters: True ### -Pattern -Specifies the text to find on each line. The pattern value is treated as a regular expression. +Specifies the text to find on each line. The pattern value is treated as a regular expression. The +parameter accepts multiple patterns in an array. If you specify more than one pattern, +`Select-String` returns matches for each pattern. To learn about regular expressions, see [about_Regular_Expressions](../Microsoft.PowerShell.Core/About/about_Regular_Expressions.md). diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Select-String.md b/reference/7.6/Microsoft.PowerShell.Utility/Select-String.md index 5e63e1f9fda0..87d191646582 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Select-String.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Select-String.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 11/05/2025 +ms.date: 04/02/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/select-string?view=powershell-7.6&WT.mc_id=ps-gethelp schema: 2.0.0 aliases: @@ -706,7 +706,9 @@ Accept wildcard characters: True ### -Pattern -Specifies the text to find on each line. The pattern value is treated as a regular expression. +Specifies the text to find on each line. The pattern value is treated as a regular expression. The +parameter accepts multiple patterns in an array. If you specify more than one pattern, +`Select-String` returns matches for each pattern. To learn about regular expressions, see [about_Regular_Expressions](../Microsoft.PowerShell.Core/About/about_Regular_Expressions.md).