sfaulstich
asked on
Need help using a CSV file to copy files to new subfolders using Powershell
I have a CSV file with headers FilePath and FileDestination. I can load it in an array with import-csv.
What I need to do is copy each file from FilePath (eg G:\99999\0001\CientWill1.P DF) to the FileDestination (e.g G:\99999\00001\Trusts and Wills\ClientWill1.PDF). Creating the subfolders as needed.
Something with Copy-Item / Foreach-object using the headers should work, but I've tried a ton of combinations, and had no success. Can anyone give me a bit of help getting this going?
Thanks,
What I need to do is copy each file from FilePath (eg G:\99999\0001\CientWill1.P
Something with Copy-Item / Foreach-object using the headers should work, but I've tried a ton of combinations, and had no success. Can anyone give me a bit of help getting this going?
Thanks,
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Thanks! If it works for you, please don't forget to close the question. Otherwise, let me know if you need anything further, or any of it explained.
Rob.
Rob.
ASKER
Rob gave me a fast answer after I was stumped. I very much appreciate the help!
ASKER
You are amazing. Thank you so much for the fast reply.