Compartilhar via


ItemCmdletProviderIntrinsics.Copy Method

Definition

Overloads

Copy(String, String, Boolean, CopyContainers)

Copy item at the specified path.

Copy(String[], String, Boolean, CopyContainers, Boolean, Boolean)

Copy item at the specified path.

Copy(String, String, Boolean, CopyContainers)

Copy item at the specified path.

public:
 System::Collections::ObjectModel::Collection<System::Management::Automation::PSObject ^> ^ Copy(System::String ^ path, System::String ^ destinationPath, bool recurse, System::Management::Automation::CopyContainers copyContainers);
public System.Collections.ObjectModel.Collection<System.Management.Automation.PSObject> Copy (string path, string destinationPath, bool recurse, System.Management.Automation.CopyContainers copyContainers);
member this.Copy : string * string * bool * System.Management.Automation.CopyContainers -> System.Collections.ObjectModel.Collection<System.Management.Automation.PSObject>
Public Function Copy (path As String, destinationPath As String, recurse As Boolean, copyContainers As CopyContainers) As Collection(Of PSObject)

Parameters

path
String

The path to the item to copy. It may be a drive or provider-qualified path and may include glob characters.

destinationPath
String

The path to copy the item to.

recurse
Boolean

If true, copies all the children in all the sub-containers of the specified container. If false, only copies the specified item.

copyContainers
CopyContainers

Determines how the source container is used in the copy operation.

Returns

The item(s) that were copied.

Exceptions

If path is null.

If the path refers to a provider that could not be found.

If the path refers to a drive that could not be found.

If path does not contain glob characters and could not be found.

If the provider that the path refers to does not support this operation.

If the provider threw an exception.

Applies to

Copy(String[], String, Boolean, CopyContainers, Boolean, Boolean)

Copy item at the specified path.

public:
 System::Collections::ObjectModel::Collection<System::Management::Automation::PSObject ^> ^ Copy(cli::array <System::String ^> ^ path, System::String ^ destinationPath, bool recurse, System::Management::Automation::CopyContainers copyContainers, bool force, bool literalPath);
public System.Collections.ObjectModel.Collection<System.Management.Automation.PSObject> Copy (string[] path, string destinationPath, bool recurse, System.Management.Automation.CopyContainers copyContainers, bool force, bool literalPath);
member this.Copy : string[] * string * bool * System.Management.Automation.CopyContainers * bool * bool -> System.Collections.ObjectModel.Collection<System.Management.Automation.PSObject>
Public Function Copy (path As String(), destinationPath As String, recurse As Boolean, copyContainers As CopyContainers, force As Boolean, literalPath As Boolean) As Collection(Of PSObject)

Parameters

path
String[]

The path(s) to the item(s) to copy. They may be a drive or provider-qualified path and may include glob characters.

destinationPath
String

The path to copy the item to.

recurse
Boolean

If true, copies all the children in all the sub-containers of the specified container. If false, only copies the specified item.

copyContainers
CopyContainers

Determines how the source container is used in the copy operation.

force
Boolean

Passed on to providers to force operations.

literalPath
Boolean

If true, globbing is not done on paths.

Returns

The item(s) that were copied.

Exceptions

If path is null.

If the path refers to a provider that could not be found.

If the path refers to a drive that could not be found.

If path does not contain glob characters and could not be found.

If the provider that the path refers to does not support this operation.

If the provider threw an exception.

Applies to