Copy a whole folder tree with Copy-Item -Recurse
The PowerShell built-in for recursive folder copies — most people forget it exists and reach for xcopy or robocopy.
01Command
$ Copy-Item -Path 'C:\Source\Project' -Destination 'D:\Backup\Project' -Recurse02What it does
Without -Recurse, Copy-Item copies only the top level, which surprises people expecting cp -r behavior. If the destination folder doesn't exist it is created, and existing files are overwritten only when you add -Force. Wildcards work too: C:\Source\* -Destination D:\Backup -Recurse copies the contents rather than a nested folder.
03Risk
04Undo
$ Remove-Item -Path 'D:\Backup\Project' -Recurse -Force05Sources
- Copy-Item - PowerShellEvidence: SS64 lists -Recurse for recursive copy and -Force to overwrite existing destination files.
- Copy-Item | Microsoft LearnEvidence: Microsoft documents that Copy-Item -Recurse copies the contents of a folder including its subdirectories, and that -Force overwrites read-only items.
Last verified: 2026-09-17 · Category: Files & Folders
06Related solutions
Diagnose NTFS file system errors and bad sectors on any volume — including the system drive while Windows is running — before committing to a repair.
Robocopy is Windows' built-in robust file copier: use /MIR to keep a destination folder as an exact one-way mirror of a source, resumable and restartable.
Search inside text files and logs with regex, returning file, line number and match.