Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Copy contents from 3 folders to one folder

$
0
0

Hi Folks,

This is my first post on PS, I have a task to copy contents from 3 folders to a target destination 

u:\FolderA\*.XLS

V:\FolderB\*.TXT

W:\FolderC\*.CSV

 

X:\TargetFolder\

This is how i tried 

$Dir1 = u:\FolderA

$Dir2 = V:\FolderB

$Dir3  = W:\FolderC

Copy-Item -LiteralPath $Dir1 -Destination $to -recurse 

I want only the contents not the root folder , loop thru all the src dirs and copy the files to the target . Is it possible ?

Viewing all articles
Browse latest Browse all 6937

Trending Articles