ItemCmdletProvider.ClearItem(String) Method

Definition

Clears the item specified by the path.

protected:
 virtual void ClearItem(System::String ^ path);
protected:
 virtual void ClearItem(Platform::String ^ path);
 virtual void ClearItem(std::wstring const & path);
protected virtual void ClearItem (string path);
abstract member ClearItem : string -> unit
override this.ClearItem : string -> unit
Protected Overridable Sub ClearItem (path As String)

Parameters

path
String

The path to the item to clear.

Remarks

Providers override this method to give the user the ability to clear provider objects using the clear-item 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 or write 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.

The default implementation of this method throws an PSNotSupportedException.

Applies to