I spent some time learning PS, but couldn’t find anything which to solve my idea. I would like to copy different files with different names and every file should go to different location. For example
source: folder X & file1 - destination: folder Y1
source: folder X & file1_2 - destination: folder Y4
source: folder X2 & file2 - destination: folder Y2
source: folder X3 & file3 - destination: folder Y3
As you see there are a different sources and different destinations.
I have to use filter as well to exclude file1_2 from copying it to folder Y1.
How to achive that ?
Get-ChildItem C:\testX -Filter file_1 | Copy-Item -Exclude file1_2 -Destination D:\testY1
Get-ChildItem C:\testX -Filter file_1_2 | Copy-Item -Destination D:\testY4
Get-ChildItem C:\testX2 -Filter file_2 | Copy-Item -Destination D:\testY2
Get-ChildItem C:\testX3 -Filter file_3 | Copy-Item -Destination D:\testY3
Would be great if log files can catch all of the copying.