Skip to content

Explain multiple pattern scenario#12920

Merged
sdwheeler merged 1 commit intoMicrosoftDocs:mainfrom
sdwheeler:sdw-w566887-sls-pat
Apr 2, 2026
Merged

Explain multiple pattern scenario#12920
sdwheeler merged 1 commit intoMicrosoftDocs:mainfrom
sdwheeler:sdw-w566887-sls-pat

Conversation

@sdwheeler
Copy link
Copy Markdown
Collaborator

@sdwheeler sdwheeler commented Apr 2, 2026

PR Summary

Explain multiple pattern scenario

PR Checklist

  • Descriptive Title: This PR's title is a synopsis of the changes it proposes.
  • Summary: This PR's summary describes the scope and intent of the change.
  • Contributor's Guide: I have read the contributor's guide.
  • Style: This PR adheres to the style guide.

Copilot AI review requested due to automatic review settings April 2, 2026 20:15
@learn-build-service-prod
Copy link
Copy Markdown
Contributor

PoliCheck Scan Report

The 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 found

More information about PoliCheck

Information: PoliCheck | Severity Guidance | Term
For any questions: Try searching the learn.microsoft.com contributor guides or post your question in the Learn support channel.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.date metadata in the affected reference pages.
  • Expand -Pattern parameter 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.

Comment on lines +709 to +711
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.
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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.

Copilot uses AI. Check for mistakes.
Comment on lines +709 to +711
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.
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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.

Copilot uses AI. Check for mistakes.
Comment on lines +709 to +711
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.
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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.

Copilot uses AI. Check for mistakes.
Comment on lines +601 to +603
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.
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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.

Copilot uses AI. Check for mistakes.
@learn-build-service-prod
Copy link
Copy Markdown
Contributor

Learn Build status updates of commit 0fc9c88:

✅ Validation status: passed

File Status Preview URL Details
reference/5.1/Microsoft.PowerShell.Utility/Select-String.md ✅Succeeded View (powershell-5.1)
reference/7.4/Microsoft.PowerShell.Utility/Select-String.md ✅Succeeded View (powershell-7.4)
reference/7.5/Microsoft.PowerShell.Utility/Select-String.md ✅Succeeded View (powershell-7.5)
reference/7.6/Microsoft.PowerShell.Utility/Select-String.md ✅Succeeded View (powershell-7.6)

For more details, please refer to the build report.

@sdwheeler sdwheeler merged commit 23d8ca7 into MicrosoftDocs:main Apr 2, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants