Search This Blog

Monday, September 27, 2010

powershell error checking during file copy with recursion

Programmer Question

I have a program that copies folders and files recursively.
example:



Copy-Item -path "$folderA" -destination "$folderB" -recurse 


Sometimes the files do not copy. Is there a way to "step inside the recursion" or a better way to do it, so I can enable some kind of error checking during the process rather than after wards. Possibly even do a Test-Path and prompt for a recopy?



Find the answer here

No comments:

Post a Comment

Related Posts with Thumbnails