Pcornel
Browse topics
Options
Recent
Favorites
Command · Windows / Windows Server / PowerShell

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.

Execution context

Standard user

Use when

You need to find an error or a setting in log or configuration files.

Then verify

Narrow the search with -Context and a more exact pattern.

Privilege Standard userState impact Read-onlyProduction Unknown

Operational impact: Read-only.
Command detailsSafety model · family · platform · verification · bundle
PrivilegeStandard user
Execution contextStandard user
State impactRead-only
Safe during productionUnknown
CategoryPowerShell
Evidence levelmixed
Primary DomainWindows
Historical technical verificationNeeds verification dateCurrent command content requires review after a Git edit.
Family Ower Hell
PlatformWindows / Windows Server / PowerShell
PrerequisiteStandard user
Output fields

Field glossary

Important fields projected from persisted Command guidance.

Filename, LineNumber, Line

Important persisted output field; use surrounding guidance for interpretation.

Command → Topic semantics

Used in these Topics

Each relation carries both placement role and operational semantic: verifies, configures, troubleshoots, collects evidence, changes state or general.

DomainsWindows

Find another Command

Reference enrichment

Evidence boundary

What this output can establish — and where you must not over-claim.

Proves

Shows the lines that match the pattern.

Does not prove

Does not prove a missing line means the event never happened, for example in a rotated log.

Next check

Narrow the search with -Context and a more exact pattern.

Depth when you need it

Command guidance

Execution context

Standard user

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.

Confirmation

Confirm action

Continue?