Hello, Dougie-
It seems like the issue you are having is with trying to write to the root of the datastore. I have the same issue, and have seen other posts about not being able to do so -- a limitation of the cmdlet, it seems.
So, how about if you try to write to a subfolder on the datastore? Like:
Copy-DatastoreItem "c:\temp\test.txt" "$($ds.DatastoreBrowserPath)\someFolder\."
dir "$($ds.DatastoreBrowserPath)\someFolder"
And, you may already know, but you should not need to do the "Get-VMHost" part of your first line, "Get-VMHost test01 | Get-Datastore...", unless you have multiple datastores by the name "test01_vmfs_local" -- just the "Get-Datastore test01_vmfs_local" should suffice.
Are you able to copy a datastore item to a subfolder?