Share via


PropertyCmdletProviderIntrinsics.Set Method

Definition

Overloads

Set(String, PSObject)

Sets the specified properties on the specified item(s)

Set(String[], PSObject, Boolean, Boolean)

Sets the specified properties on the specified item(s)

Set(String, PSObject)

Sets the specified properties on the specified item(s)

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

Parameters

path
String

The path to the item to set the properties on.

propertyValue
PSObject

The properties that are to be set on the item

Returns

A PSObject for each item that had the property set on it.

Exceptions

If path or property 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

Set(String[], PSObject, Boolean, Boolean)

Sets the specified properties on the specified item(s)

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

Parameters

path
String[]

The path(s) to the item(s) to set the properties on.

propertyValue
PSObject

The properties that are to be set on the item

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 had the property set on it.

Exceptions

If path or property 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