Share via


IDynamicPropertyCmdletProvider.NewProperty Method

Definition

Creates a new property on the specified item.

public:
 void NewProperty(System::String ^ path, System::String ^ propertyName, System::String ^ propertyTypeName, System::Object ^ value);
public:
 void NewProperty(Platform::String ^ path, Platform::String ^ propertyName, Platform::String ^ propertyTypeName, Platform::Object ^ value);
void NewProperty(std::wstring const & path, std::wstring const & propertyName, std::wstring const & propertyTypeName, winrt::Windows::Foundation::IInspectable const & value);
public void NewProperty (string path, string propertyName, string propertyTypeName, object value);
public void NewProperty (string path, string propertyName, string propertyTypeName, object? value);
abstract member NewProperty : string * string * string * obj -> unit
Public Sub NewProperty (path As String, propertyName As String, propertyTypeName As String, value As Object)

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.

Remarks

Providers override this method to give the user the ability to add properties to provider objects using the new-itemproperty cmdlet.

Providers that declare ProviderCapabilities of ExpandWildcards, Filter, Include, or Exclude should ensure that the path passed meets those requirements by accessing the appropriate property from the base class.

By default overrides of this method should not create new properties on objects that are generally hidden from the user unless the Force property is set to true. An error should be sent to the WriteError method if the path represents an item that is hidden from the user and Force is set to false.

Applies to