Udostępnij za pośrednictwem


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.

public:
 void Remove(System::String ^ path, bool recurse);
public:
 void Remove(Platform::String ^ path, bool recurse);
void Remove(std::wstring const & path, bool recurse);
public void Remove (string path, bool recurse);
member this.Remove : string * bool -> unit
Public Sub Remove (path As String, recurse As Boolean)

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

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

Removes the items at the given path.

public:
 void Remove(cli::array <System::String ^> ^ path, bool recurse, bool force, bool literalPath);
public:
 void Remove(Platform::Array <Platform::String ^> ^ path, bool recurse, bool force, bool literalPath);
void Remove(std::Array <std::wstring const &> const & path, bool recurse, bool force, bool literalPath);
public void Remove (string[] path, bool recurse, bool force, bool literalPath);
member this.Remove : string[] * bool * bool * bool -> unit
Public Sub Remove (path As String(), recurse As Boolean, force As Boolean, literalPath As Boolean)

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