Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

DeleteDirectory

Deletes all directories and subdirectories in the specified path. Will not do anything if the directory do not exist.

Task version: 1.2.0

Required Frends version: 5.7+

Required .NET version: 8.0

Compatible Agents: Crossplatform

Task Parameters

Name
Description

Directory : String

Directory path.

Default: "c:\temp" Example: C:\Temp

Name
Description

DeleteRecursively : Boolean

Delete all files and sub folders.

Default: False Example: true

UseGivenUserCredentialsForRemoteConnections : Boolean

If set, allows you to give the user credentials to use to create directories on remote hosts.

If not set, the agent service user credentials will be used.

Note: For creating directories on the local machine, the agent service user credentials will always be used, even if this option is set.

Default: - Example: true

UserName : String

This needs to be of format domain\username

Default: "domain\username" Example: Domain\Username

🗝Password : String

Password of user

Default: - Example: Password123

ThrowErrorOnFailure : Boolean

Whether to throw an error on failure.

Default: True Example: true

ErrorMessageOnFailure : String

Overrides the error message on failure. If is true,

the original exception is wrapped in a new exception with this message.

Default: - Example: Directory deletion failed

Task Result

Name
Description

Error : Error

Error that occurred during task execution. Example: object { string Message, Exception AdditionalInfo }

Error.Message : String

Summary of the error. Example: Access denied to the directory.

Error.AdditionalInfo : Exception

Additional information about the error. Example: object { Exception AdditionalInfo }

Path : String

Path of directory Example: C:/User/NewDirectory

Success : Boolean

Directory found Example: C:/User/NewDirectory

Task Changelog

Changelog for Task Frends.Files.DeleteDirectory.

[1.2.0] - 2026-09-30

Changed

  • Updated the task to .NET 8 and added cancellation support.

  • Added configurable error handling for directory deletion failures.

[1.1.0] - 2025-03-19

Changed

  • Update packages: Newtonsoft.Json 12.0.1 -> 13.0.3 System.ComponentModel.Annotations 4.7.0 -> 5.0.0 System.Runtime.Caching 7.0.0 -> 9.0.3 coverlet.collector 3.1.0 -> 6.0.4 Microsoft.NET.Test.Sdk 16.7.0 -> 17.13.0 MSTest.TestAdapter 2.1.2 -> 3.8.3 MSTest.TestFramework 2.1.2 -> 3.8.3 nunit 3.12.0 -> 4.3.2 NUnit3TestAdapter 3.17.0 -> 5.0.0 RichardSzalay.MockHttp 6.0.0 -> 7.0.0 xunit.extensibility.core 2.4.2 -> 2.9.3

[1.0.0] - 2023-07-21

Added

  • Initial implementation of Frends.Files.DeleteDirectory.

Last updated

Was this helpful?