ItemCmdletProviderIntrinsics.Clear Method

Definition

Overloads

Clear(String)

Clears the item at the specified path.

Clear(String[], Boolean, Boolean)

Clears the item at the specified path.

Clear(String)

Clears the item at the specified path.

C++
public:
 System::Collections::ObjectModel::Collection<System::Management::Automation::PSObject ^> ^ Clear(System::String ^ path);

Parameters

path
String

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

Returns

The object(s) cleared 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

PowerShell SDK 7.4.0 и друге верзије
Производ Верзије
PowerShell SDK 7.2.0, 7.3.0, 7.4.0
Windows PowerShell 5.1.0.0

Clear(String[], Boolean, Boolean)

Clears the item at the specified path.

C++
public:
 System::Collections::ObjectModel::Collection<System::Management::Automation::PSObject ^> ^ Clear(cli::array <System::String ^> ^ path, bool force, bool literalPath);

Parameters

path
String[]

The path(s) to the item to clear. It may be a drive or provider-qualified path and may include glob characters.

force
Boolean

Passed on to providers to force operations.

literalPath
Boolean

If true, globbing is not done on paths.

Returns

The object(s) cleared 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

PowerShell SDK 7.4.0 и друге верзије
Производ Верзије
PowerShell SDK 7.2.0, 7.3.0, 7.4.0
Windows PowerShell 5.1.0.0