Copy-DatastoreItem

Synopsis

Copies items between datastores and between a datastore and a local file system provider.

Syntax

Copy-DatastoreItem [-Item] <Object[]> [[-Destination] <Object>] [-Force] [-PassThru] [-Recurse] [-WhatIf] [-Confirm] [<CommonParameters>]

Related Commands

Detailed Description

Copies items between datastores and between a datastore and a local file system provider.

Parameters

NameDescriptionRequired?Pipeline InputDefault Value
ItemSpecify the datastore item you want to copy. You can use a string to provide a relative path to the item in the current provider location.truetrue (ByValue)
DestinationSpecify the destination where you want to copy the datastore item. You can use a string to specify a relative path to the destination object in the current provider location.falsefalse.
ForceIndicate whether to overwrite all items with the same name at the provided destination.falsefalse$false
PassThruIndicate that the cmdlet returns the copied item.falsefalse$false
RecurseIndicate that you want to copy not only the item, but its children items as well.falsefalse$false
WhatIfIndicate that the cmdlet is run only to display the changes that would be made and actually no objects are modified.falsefalse
ConfirmIndicate that the cmdlet asks for confirmation before running.falsefalse

Input Type

Return Type

VMware.VimAutomation.Types.Object

Notes

This functionality is supported only on servers that are ESX 3.5 and vCente
    r 2.5, and higher.

Examples

--------------  Example 1 --------------

C:\PS>Copy-DatastoreItem ds:\MyVM\* c:\VMFolder\MyVM\


Copies all items in the MyVM folder in the datastore provider locally to c:\VMFo
lder\MyVM\.




--------------  Example 2 --------------

C:\PS>Copy-DatastoreItem c:\VMFolder\MyNewVM\* ds:\NewVM\ -Force


Copies all files in the MyNewVM local folder to the NewVM folder in the datastor
e provider.

Copyright © 1998 - 2009 VMware, Inc. All rights reserved.