I was trying the accepted solution here: https://serverfault.com/questions/194827/writing-a-powershell-script-to-copy-files-with-certain-extension-from-one-folder/223014#223014 But it doesnt work, and my comment on the accepted solution is not getting a response.
I am trying to copy all pictures I have in my Pictures drive (only PNG, JPG, without the video files) to a different drive, but having no luck.
Ideally I want to copy recursively, but to a flat destination (not mirroring the source sub-directories)
I tried this command:
Copy-Item -path "C:\Users\genadi\Pictures\" -include "*.JPG", "*.PNG" -Destination "D:\" with and without
-recurse but nothing happens.
Ideally, I want a script that will 1) reduce original size of all JPG and PNG pictures (including all sub-folders) and 2) copy the reduced size to specified destination.
Currently my originals are about 20GB, I need to fit them on a flash drive for display/printing purposes etc. and easily repeat this when needed (hence why script would be nice).