# Invoke-Command and copy-item

I am trying to copy files on a remote machine to another location on the same machine, effectively a backup. I build the source and destination paths from various bits of data, and use Invoke-Command to complete the action from a remote machine. From the command line, everything works.
But from within a scrip:
Invoke-Command -ComputerName Server6 { Copy-Item -Path C:\program files\software\BIN* -Destination E:\sw_install\1\BIN_6.2\ -Recurse -Force }
Container cannot be copied onto existing leaf item.
+ CategoryInfo : InvalidArgument: (C:\program file…BIN\Plugins:String) [Copy-Item], PSArgumentException
+ FullyQualifiedErrorId : CopyContainerItemToLeafError,Microsoft.PowerShell.Commands.CopyItemCommand

The files are all copied, but the sub folders and their contents are not.

What do I need to do?

Just get rid of “*” in

`Copy-Item -Path C:\program files\software\BIN\* -Destination E:\sw_install\1\BIN_6.2\ -Recurse -Force `

It really was that easy! Many Thanks!