Hi All,
I am trying to copy VM's VMDK files from VMware stores to my local C:\ computer and coming across a problem using the PowerCLI 5.1 cmdlet Copy-DatastoreItem when Data center has forward slash / in the name e.g Data/Center. I have tried to use the escape sequence "%2f" to replace the / in the variable beforehand but for some reason it still does not work and get the same error saying it cannot find the source file. I have confirmed that my method works as I've been using this extensively with other DataCenters names without a forward slash /.
I have also tried Mapping the Datastore with a PS Drive with the New-PSDrive cmdlet and then trying to do the Copy-DatastoreItem but get the same error saying it cannot find the source vmdk file.
Copy-DatastoreItem : 2/08/2013 12:09:19 PM Copy-DatastoreItem
Cannot find path 'vmstore:\Data %2fStore\TestDataStore\TestVM\TestVM.vmdk' because it does not exist.
At F:\Scripts\copy-datastoreitemproblem.ps1:57 char:13
+ Copy-DatastoreItem -Item $VMwareSource -Destination $VMDK ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (System.Object[]:Object[]) [Copy-DatastoreItem], VimException
+ FullyQualifiedErrorId : Core_CopyDatastoreItem_TryValidateSourceItem_InvalidSourceItem,VMware.VimAutomation.ViCore.Cmdlets.Commands.CopyDatastoreItem
If anyone has any suggestions I could try I’d be very grateful to hear from you.
-Jason