Powershell Copy-Item recursively but don't include folder name

Your command is telling PowerShell to copy the folder itself, with all its contents, to the destination folder. To copy only the contents of the original folder, change your path as follows:

Copy-Item -Path "C:\FolderA\*" -Destination "C:\FolderB\" -recurse -Force -Verbose

Notice the asterisk (*) after the folder name. This will copy the content (including subfolders) of the folder, but not the folder itself to the destination folder.

Using the Copy-Item Cmdlet

Tags:

Powershell