# Searching

Find text inside files and files anywhere.

Updated: November 10, 2026

## [Finding Text](https://www.ask-codey.com/courses/powershell-in-depth/topics/powershell-finding-text)

1. [Finding Text: Select-String](https://www.ask-codey.com/lessons/powershell-select-string) (Apprentice): Select-String searches the text inside files for a word, in one file or in many at once, and shows each matching line with its file name and line number, as objects you can pick from like any other.

## [Finding Files](https://www.ask-codey.com/courses/powershell-in-depth/topics/powershell-finding-files)

1. [Finding Files: Get-ChildItem -Recurse](https://www.ask-codey.com/lessons/powershell-finding-files) (Apprentice): Get-ChildItem -Recurse looks in a folder and in every folder inside it, so -Filter finds a file by its name wherever it is, Where-Object finds files by size or date, and Select-String can then search the text inside them all.

## [Patterns](https://www.ask-codey.com/courses/powershell-in-depth/topics/powershell-patterns)

1. [Patterns: Regular Expressions with -match](https://www.ask-codey.com/lessons/powershell-regular-expressions) (Journeyman): A regular expression describes the shape of the text you want, such as two letters, a dash and some digits, and -match tests text against it, $Matches holds what it found, and Select-String uses the same patterns across many files.

## [Exercise: The Archive Detective](https://www.ask-codey.com/courses/powershell-in-depth/topics/exercise-powershell-the-archive-detective)

1. [Exercise: The Archive Detective](https://www.ask-codey.com/lessons/exercise-powershell-the-archive-detective) (Apprentice): Solve the case of the archive's missing telescope with PowerShell's searches, a pattern through two weeks of door logs, the staff list, the lockers and the storage room, and let a Pester check tell you which answers are right.

Source: https://www.ask-codey.com/courses/powershell-in-depth/chapters/powershell-searching
