Explain multiple pattern scenario#12920
Conversation
PoliCheck Scan ReportThe following report lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 and severity-2 issues. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a PR comment and include this text: #policheck-false-positive. This feedback helps reduce false positives in future scans. ✅ No issues foundMore information about PoliCheckInformation: PoliCheck | Severity Guidance | Term |
There was a problem hiding this comment.
Pull request overview
Updates Select-String reference docs to better explain the -Pattern parameter’s support for multiple patterns across supported PowerShell versions.
Changes:
- Update
ms.datemetadata in the affected reference pages. - Expand
-Patternparameter description to note that it accepts an array of patterns and returns matches per pattern.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| reference/7.6/Microsoft.PowerShell.Utility/Select-String.md | Updates doc date and clarifies -Pattern multi-pattern behavior. |
| reference/7.5/Microsoft.PowerShell.Utility/Select-String.md | Updates doc date and clarifies -Pattern multi-pattern behavior. |
| reference/7.4/Microsoft.PowerShell.Utility/Select-String.md | Updates doc date and clarifies -Pattern multi-pattern behavior. |
| reference/5.1/Microsoft.PowerShell.Utility/Select-String.md | Updates doc date and clarifies -Pattern multi-pattern behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| 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. |
There was a problem hiding this comment.
The -Pattern description states that the value "is treated as a regular expression", but this isn’t always true when -SimpleMatch is used (see the -SimpleMatch section, which says the Pattern value isn’t interpreted as regex). Consider rewording to "By default, the pattern is treated as a regular expression" (or cross-reference -SimpleMatch) so the behavior is accurately described.
| 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. | |
| Specifies the text to find on each line. By default, the pattern value is treated as a regular | |
| expression. When you use **-SimpleMatch**, the value is interpreted literally. The parameter | |
| accepts multiple patterns in an array. If you specify more than one pattern, `Select-String` | |
| returns matches for each pattern. |
| 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. |
There was a problem hiding this comment.
The -Pattern description states that the value "is treated as a regular expression", but this isn’t always true when -SimpleMatch is used (see the -SimpleMatch section, which says the Pattern value isn’t interpreted as regex). Consider rewording to "By default, the pattern is treated as a regular expression" (or cross-reference -SimpleMatch) so the behavior is accurately described.
| 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. | |
| Specifies the text to find on each line. By default, the pattern value is treated as a regular | |
| expression. If you use **-SimpleMatch**, the pattern is matched literally. The parameter accepts | |
| multiple patterns in an array. If you specify more than one pattern, `Select-String` returns | |
| matches for each pattern. |
| 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. |
There was a problem hiding this comment.
The -Pattern description states that the value "is treated as a regular expression", but this isn’t always true when -SimpleMatch is used (see the -SimpleMatch section, which says the Pattern value isn’t interpreted as regex). Consider rewording to "By default, the pattern is treated as a regular expression" (or cross-reference -SimpleMatch) so the behavior is accurately described.
| 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. | |
| Specifies the text to find on each line. By default, the pattern value is treated as a | |
| regular expression. Use **-SimpleMatch** to match the text literally. The parameter accepts | |
| multiple patterns in an array. If you specify more than one pattern, `Select-String` | |
| returns matches for each pattern. |
| 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. |
There was a problem hiding this comment.
The -Pattern description states that the value "is treated as a regular expression", but this isn’t always true when -SimpleMatch is used (see the -SimpleMatch section, which says the Pattern value isn’t interpreted as regex). Consider rewording to "By default, the pattern is treated as a regular expression" (or cross-reference -SimpleMatch) so the behavior is accurately described.
| 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. | |
| Specifies the text to find on each line. By default, 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. |
|
Learn Build status updates of commit 0fc9c88: ✅ Validation status: passed
For more details, please refer to the build report. |
PR Summary
Explain multiple pattern scenario
PR Checklist