Syntax
Copy-DatastoreItem [-Item] <Object[]> [[-Destination] <Object>] [-Force] [-PassThru] [-Recurse] [-WhatIf] [-Confirm] [<CommonParameters>]Related Commands
Online versionDetailed Description
This cmdlet copies items between datastores and between a datastore and a local file system provider.Parameters
Return Type
Zero or more FileInfo or DatastoreItem objectsNotes
Examples
-------------- Example 1 --------------
Copy-DatastoreItem vmstore:\Datacenter\Storage1\MyVM\* c:\VMFolder\MyVM\
Copies the contents of a datastore folder in a local folder.
-------------- Example 2 --------------
Copy-DatastoreItem c:\VMFolder\MyVM\* vmstore:\Datacenter\Storage1\NewVM\ -Force
Copies the contents of a local folder into a datastore folder. If the destination folder does not exist, the Force parameter enforces its creation.
-------------- Example 3 --------------
Copy-DatastoreItem c:\VMFolder\* vmstore:\Datacenter\Storage1\VMs\ -Force -Recurse
Copies recursively the contents of a local folder into a datastore folder.
-------------- Example 4 --------------
Copy-DatastoreItem Windows.ISO vmstore:\Datacenter\Storage1\ISOFiles\WinXPSP3.iso
Copies a file into a datastore folder and changes the file name.