ItemCmdletProviderIntrinsics.Remove Method

Definition

Overloads

Remove(String, Boolean)

Removes the items at the given path.

Remove(String[], Boolean, Boolean, Boolean)

Removes the items at the given path.

Remove(String, Boolean)

Removes the items at the given path.

C++
public:
 void Remove(System::String ^ path, bool recurse);

Parameters

path
String

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

recurse
Boolean

If true, removes all the children in all the sub-containers of the specified container. If false, only removes the immediate children of the specified container.

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 et autres versions
Produit Versions
PowerShell SDK 7.2.0, 7.3.0, 7.4.0
Windows PowerShell 5.1.0.0

Remove(String[], Boolean, Boolean, Boolean)

Removes the items at the given path.

C++
public:
 void Remove(cli::array <System::String ^> ^ path, bool recurse, bool force, bool literalPath);

Parameters

path
String[]

The path(s) to the item(s) to remove. They may be drive or provider-qualified paths and may include glob characters.

recurse
Boolean

If true, removes all the children in all the sub-containers of the specified container. If false, only removes the immediate children of the specified container.

force
Boolean

Passed on to providers to force operations.

literalPath
Boolean

If true, globbing is not done on paths.

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 et autres versions
Produit Versions
PowerShell SDK 7.2.0, 7.3.0, 7.4.0
Windows PowerShell 5.1.0.0