Dela via


PropertyCmdletProviderIntrinsics.Rename Method

Definition

Overloads

Rename(String, String, String)

Renames a property on the specified item(s)

Rename(String[], String, String, Boolean, Boolean)

Renames a property on the specified item(s)

Rename(String, String, String)

Renames a property on the specified item(s)

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

Parameters

path
String

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

sourceProperty
String

The source name of the property to be renamed.

destinationProperty
String

The new name of the property.

Returns

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

Exceptions

If path, sourceProperty, or destinationProperty 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

Rename(String[], String, String, Boolean, Boolean)

Renames a property on the specified item(s)

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

Parameters

path
String[]

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

sourceProperty
String

The source name of the property to be renamed.

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 rename.

Exceptions

If path, sourceProperty, or destinationProperty 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