Partilhar via


PropertyCmdletProviderIntrinsics.New Method

Definition

Overloads

New(String, String, String, Object)

Creates a new property on the specified item.

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

Creates a new property on the specified item.

New(String, String, String, Object)

Creates a new property on the specified item.

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

Parameters

path
String

The path to the item on which the new property should be created.

propertyName
String

The name of the property that should be created.

propertyTypeName
String

The type of the property that should be created.

value
Object

The new value of the property that should be created.

Returns

A PSObject for each item that the property was created on. The PSObject contains the properties that were created.

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

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

Creates a new property on the specified item.

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

Parameters

path
String[]

The path(s) to the item(s0 on which the new property should be created.

propertyName
String

The name of the property that should be created.

propertyTypeName
String

The type of the property that should be created.

value
Object

The new value of the property that should be created.

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 the property was created on. The PSObject contains the properties that were created.

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