Using Powershell, How can I delete folders in the destination folder only if they exist in the source folder?
For example I have the folder structure below and want to delete Folders1 2 and 3 before I copy them from the source folder. I have tried Robocopy with the /mir switch however this deletes folder4 as well
Source folder:
Folder1
Folder2
Folder3
Destination folder:
Folder1
Folder2
Folder3
Folder4