Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 236824

Re: Copy-DatastoreItem template vm folder between virtual centers

$
0
0

Hello-

 

I'd say that the issue lies with the way that you are trying to use the items from the CSV.  With the way you have it written, the properties of the pipeline object are not being accessed, and so the Copy-DatastoreItem cmdlet is getting invalid values for the Destination parameter.  Try using subexpressions around the two portions of the destination access properties of the pipeline object, like:

 

Import-Csv"c:\remoteoffice_esx.csv"-UseCulture | %{
   
Copy-DatastoreItem c:\PS\* vmstore:\$($_.Datacenter)\$($_
.Datastore) -Force
}

 

And, the ForEach statement inside of the Foreach-Object statement was extraneous, so I omitted that.  This work better for you?


Viewing all articles
Browse latest Browse all 236824

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>