ItemCmdletProviderIntrinsics.Set Method

Definition

Overloads

Set(String, Object)

Sets the item at the specified path.

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

Sets the item at the specified path.

Set(String, Object)

Sets the item at the specified path.

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

Parameters

path
String

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

value
Object

The new value to set the item to.

Returns

The object(s) set at the specified path.

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

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

Sets the item at the specified path.

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

Parameters

path
String[]

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

value
Object

The new value to set the item to.

force
Boolean

Passed on to providers to force operations.

literalPath
Boolean

If true, globbing is not done on paths.

Returns

The object(s) set at the specified path.

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