How to copy content of a folder to another specific folder using powershell?

Copy-Item with Force looks like what you are looking for.

[string]$sourceDirectory  = "C:\Source\*"
[string]$destinationDirectory = "C:\Destination\"
Copy-item -Force -Recurse -Verbose $sourceDirectory -Destination $destinationDirectory

Copy-item never delete extra files or folders in destination, but with
-force it will overwrite if file already exists

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)