In order to copy files to or from a vSAN datastore folder using Copy-DatastoreItem, specify the object UUID of the target folder in the cmdlet.
Example usage of the Get-VSANDatastoreFolders function with Copy-DatastoreItem cmdlet:
PS C:\Windows\system32> $datastore = Get-Datastore -Name vsanDatastore
PS C:\Windows\system32> Get-VSANDatastoreFolders -Datastore $datastore -Server 10.10.10.10
Name Path
---- ----
folder1 [vsanDatastore] ########-####-####-####-########17ad
folder2 [vsanDatastore] ########-####-####-####-########662e
PS C:\Windows\system32> Copy-DatastoreItem c:\filename.ext vmstore:\Datacenter_name\vsanDatastore\########-####-####-####-########17ad\filename.ext
NOTE: The only approved method for migrating VMs to and from vSAN is storage vMotion. The above method is not to be used when migrating VMs to and from vSAN.