In PowerShell Copy-Item bahaves differently when target folder exists and different when not. Module provides functionality which is idempotent.
When you are using Copy-Item the destination doesn’t exist it assumes you’re trying to copy/rename the source to be the destination, whereas if the destination exists it assumes you’re trying to copy underneath it. This results sometimes in copying directory to requested destination and sometimes to folder inside it.
Example below visualize the situation. Initial state:
After first Copy-Item invocation.
TestElement directory is copied under Test directory.
And after second Copy-Item invocation whole Test directory is copied to target Test.
Following module helps when you would like to copy content of one folder to other and always have the same result every time.