PropertyCmdletProviderIntrinsics.Copy Method

Definition

Overloads

Copy(String, String, String, String)

Copies a property on the specified item(s)

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

Copies a property on the specified item(s)

Copy(String, String, String, String)

Copies a property on the specified item(s)

public:
 System::Collections::ObjectModel::Collection<System::Management::Automation::PSObject ^> ^ Copy(System::String ^ sourcePath, System::String ^ sourceProperty, System::String ^ destinationPath, System::String ^ destinationProperty);
public System.Collections.ObjectModel.Collection<System.Management.Automation.PSObject> Copy (string sourcePath, string sourceProperty, string destinationPath, string destinationProperty);
member this.Copy : string * string * string * string -> System.Collections.ObjectModel.Collection<System.Management.Automation.PSObject>
Public Function Copy (sourcePath As String, sourceProperty As String, destinationPath As String, destinationProperty As String) As Collection(Of PSObject)

Parameters

sourcePath
String

The path to the item(s) on which the property should be copied.

sourceProperty
String

The source name of the property to be copied.

destinationPath
String

The path to the item(s) to copy the property to. It can be the same as the sourcePath as long as the destinationProperty is different.

destinationProperty
String

The new name of the property.

Returns

A PSObject for each item that is the new property after the copy.

Exceptions

If sourcePath, sourceProperty, destinationPath, or destinationProperty is null.

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

If the sourcePath 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 sourcePath refers to does not support this operation.

If the provider threw an exception.

Applies to

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

Copies a property on the specified item(s)

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

Parameters

sourcePath
String[]

The path(s) to the item(s) on which the property should be copied.

sourceProperty
String

The source name of the property to be copied.

destinationPath
String

The path to the item(s) to copy the property to. It can be the same as the sourcePath as long as the destinationProperty is different.

destinationProperty
String

The new name of the property.

force
Boolean

Passed on to providers to force operations.

literalPath
Boolean

If true, globbing is not done on paths.

Returns

A PSObject for each item that is the new property after the copy.

Exceptions

If sourcePath, sourceProperty, destinationPath, or destinationProperty is null.

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

If the sourcePath 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 sourcePath refers to does not support this operation.

If the provider threw an exception.

Applies to