Not sure why you had to use fullname an I didn't...
There's probably a more efficient way to do it but this got the customers request taken care of.
If I have to do this again I'll probably try to tweak performance.
Are your PDF files large. Since we're using get-content to extract the %PDF part of the file for version I think it makes since that if the files are large it wll take a while. I went through 1806 files in about 15-20 minutes but the files were averaging probably 500K.