We help IT Professionals succeed at work.
Get Started

Need help using a CSV file to copy files to new subfolders using Powershell

sfaulstich
sfaulstich asked
on
64 Views
Last Modified: 2015-02-27
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.PDF) 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,
Comment
Watch Question
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2014
Commented:
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE