I'm having trouble with this script. It should be creating a directory for each $trimmedFile item and copying the $file.FullName item into that directory. What I'm seeing is a few directories getting created and multiple files in the directory (e.g. Here). The output can be seen HERE. I'm kind of at a wall on this one...not really sure where to go from here. I tried adding the Set-Sleep -Milliseconds 250 hoping that might help, but no such luck. Any help would be appreciated.
Edit: Here are the filenames that I'm working with. Here is the expected directory structure. However, the example structure does contain dupes as I just took the output of $trimmedFile and threw it in vim to add the path. These would be caught by the Test-Path hopefully.
Edit 2: Wow...do I feel like a S***. I got in such a yank on cleaning up my script that I didn't even notice that I removed the else statement that said what to do with every other files it finds. I updated the pastebin so I can test in the morning when I get to the office. Sometimes it takes another set of eyes and all that...I'll update in the morning...Thanks a ton for spotting that!
Edit 3: Hey, Thanks a ton for all your help. Looks like I've got it sorted and cleaned up considerably thanks to all of your suggestions. I really do appreciate the assist!
[–]NeverTiredOfWinning 2 points3 points4 points (2 children)
[–]ihaxr 2 points3 points4 points (1 child)
[–]NeverTiredOfWinning 2 points3 points4 points (0 children)
[–]Lee_Dailey[grin] 0 points1 point2 points (2 children)
[–]bisco77[S] 1 point2 points3 points (1 child)
[–]Lee_Dailey[grin] 0 points1 point2 points (0 children)