'Powershell Task Synchronization

Task: Synchronization from source to destination path. As a result, both the source and destination paths should contain the latest files. Individual files can be filtered out.

I only know how to copy files into a destination but I need to synchronize them, which is way too hard to me.

What I did:

Clear
copy-item -path C:\Users\name\Documents\Source\* "C:\Users\name\Documents\Destination" -PassThru


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source