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.