Both of those are solid answers for powershell, but it would probably be far more easy to just leverage Robocopy (MS Supplied robust copy application).
robocopy "C:\SourceDir\" "C:\DestDir\" /MIR
would accomplish the same thing.
Both of those are solid answers for powershell, but it would probably be far more easy to just leverage Robocopy (MS Supplied robust copy application).
robocopy "C:\SourceDir\" "C:\DestDir\" /MIR
would accomplish the same thing.