I have a folder full of files, let's call it folder A, some of which (but not all) are also present in another folder, called folder B.
The files in B are out of date, and I would like to copy the newer versions of those files from A to B (overwrite the ones in B), but not copy all of the extra files from A which do not already exist in B.
There may also be files in B that are not in A.
Is there a way to do this with powershell? I know I can probably do it with xcopy
, as in this question but I am looking for a pure Powershell solution.
I do not care if the files are newer, older or unchanged etc.