Commands / Files

Copy-Item

Copy a file or folder

beginner Files Aliases copycpicp

Copy-Item
 Copy-Item -Path .\notes.txt -Destination .\backup\notes.txt
Works on
WindowsLinuxmacOS
PowerShell
5.1 and later
Reference
Microsoft Learn: Copy-Item

Copies a file or folder. The destination can be a file name or a folder that already exists.

Use -Recurse for folders. Use -WhatIf first if you are unsure.

Try this

Copy-Item -Path .\docs -Destination .\docs-copy -Recurse -WhatIf

Coming from another shell

ShellWhat you might type
bash / zshcp notes.txt backup/
cmd.execopy notes.txt backup\

More in From bash and From cmd.

Related commands