Standard user
Select-String -Path <file> -Pattern <text>
Select-String -Path <file> -Pattern <text>
Searches files for a text or regular expression pattern, like grep or findstr.
You need to find an error or a setting in log or configuration files.
Narrow the search with -Context and a more exact pattern.
Privilege Standard userState impact Read-onlyProduction Unknown
Field glossary
Important fields projected from persisted Command guidance.
Filename, LineNumber, LineImportant persisted output field; use surrounding guidance for interpretation.
Used in these Topics
Each relation carries both placement role and operational semantic: verifies, configures, troubleshoots, collects evidence, changes state or general.
Evidence boundary
What this output can establish — and where you must not over-claim.
Shows the lines that match the pattern.
Does not prove a missing line means the event never happened, for example in a rotated log.
Narrow the search with -Context and a more exact pattern.
Command guidance
Execution context
Standard user
Use when
You need to find an error or a setting in log or configuration files.
Important fields
Filename, LineNumber, Line
Common problems
pattern is a regular expression by default; encoding of the file
Operational impact
Read-only.
Technical context
Use -SimpleMatch for plain text and -Context 2,2 to show lines around the match.