IPropertyCmdletProvider.ClearProperty Method

Definition

Clears a property of the item at the specified path.

public:
 void ClearProperty(System::String ^ path, System::Collections::ObjectModel::Collection<System::String ^> ^ propertyToClear);
public void ClearProperty (string path, System.Collections.ObjectModel.Collection<string> propertyToClear);
abstract member ClearProperty : string * System.Collections.ObjectModel.Collection<string> -> unit
Public Sub ClearProperty (path As String, propertyToClear As Collection(Of String))

Parameters

path
String

The path to the item on which to clear the property.

propertyToClear
Collection<String>

The name of the property to clear.

Remarks

Providers override this method to give the user the ability to clear the value of provider object properties using the clear-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 clear properties from 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.

An PSObject can be used as a property bag for the properties that need to be returned if the providerSpecificPickList contains multiple properties to write.

Applies to