Copy-Item
- Description
- Copies an item from one location to another.
- Syntax
Copy-Item [-Path] <String[]> [[-Destination] <String>] [-Recurse] [-Force]
- Example
Copy-Item -Path 'C:\Source\*' -Destination 'C:\Destination' -Recurse
- Parameters
- Path: Required. Specifies the path to the items to copyDestination: Optional. Specifies the path to the new locationRecurse: Optional. Copies the item and all its child itemsForce: Optional. Forces the command to run without asking for confirmation
- Return type
- None or the copied item
- Aliases
- cpi, cp, copy
- Supported Windows versions
- Windows PowerShell 2.0 and laterWindows 7Windows 8Windows 10Windows 11Windows Server 2008 R2 and later