Skip to content

Glossary: Command Line for IT: Bash and PowerShell

-replace

A PowerShell operator that replaces whatever a regular expression matches. '2026-10-29T03:12:45' -replace 'T.*', '' leaves just the date, and '$1' in the replacement means group 1.

Where the book teaches it

Related terms

-matchsedregular expression (regex)