-Recurse

noun

say it: “ree-KURSS” /riˈkɜrs/

A PowerShell parameter that makes a command look inside every folder below the one you name, however deep.

What does -Recurse do?

-Recurse makes Get-ChildItem look in the folder you name and in every folder inside it, however deep. Without it, a file saved one folder down is never found. -Filter and -File narrow what it lists.

Get-ChildItem -Filter '*budget*'              # this folder only: nothing
Get-ChildItem -Recurse -Filter '*budget*'     # every folder below

In a sentence

  • “Sam added -Recurse so the search went into every folder below.”
  • “Without -Recurse, Get-ChildItem looked only in the hiking-club folder and missed the budget file in photos.”

Level: Apprentice · More PowerShell terms at this level

Updated