Trying to copy all items in a folder without copying hidden items.

by Nov 7, 2016

I am trying to copy all items in a folder including all subfolders.  The problem is that my command is also trying to copy all the hidden subfolders.  Is there any way that I can avoid that? 

This is the code that I am using:

Copy-Item -path "C:users$usernamedocuments" -recurse -destination "\mainlocationbackup$username" -force

Any help will be greatly appreciated.