Delete
Delete files.
Task version: 2.0.0
Required Frends version: 5.7+
Required .NET version: 8.0
Compatible Agents: Crossplatform
Task Parameters
Directory : String
Source directory.
Default: -
Example: c:\temp
Pattern : String
Pattern to match relative to Directory. Matching is case-insensitive and separators are normalized to /. For regex mode, prefix the pattern with and the matcher checks the full relative path and filename. For wildcard mode, * and ** work as glob operators and regex special characters are treated literally.
Default: "\Folder*.xml"
Example: /Folder/.xml, Folder/.txt, report-.csv, ^(?!prof)._test.txt
UseGivenUserCredentialsForRemoteConnections : Boolean
If set, allows you to give the user credentials to use to delete files on remote hosts.
If not set, the agent service user credentials will be used.
Note: This feature is only possible with Windows agents.
Default: False
Example: true
UserName : String
This needs to be of format domain\username
Default: "domain\username"
Example: domain\username
🗝Password : String
Password for the used credentials.
Default: -
Example: testpwd
Task Result
Files : List<FileItem>
List of file items deleted from directory.
Example: [test.txt, test2.txt]
Task Changelog
Changelog for Task Frends.Files.Delete.
[2.0.0] - 2026-09-10
Changed
Upgraded the task to .NET 8.
[Breaking Change] Standardize pattern matching logic between tasks.
Clarified relative input matching rules: patterns are evaluated relative to Directory, separators are normalized to /, matching is case-insensitive, glob mode supports * and **, and <regex> enables regex evaluation against the relative path and file name.
[1.2.0] - 2025-03-19
Changed
Update packages: Microsoft.Extensions.FileSystemGlobbing 7.0.0 -> 9.0.3 System.ComponentModel.Annotations 4.7.0 -> 5.0.0 System.DirectoryServices 7.0.0 -> 8.0.0 coverlet.collector 3.1.0 -> 6.0.4 Microsoft.NET.Test.Sdk 16.6.1 -> 17.13.0 MSTest.TestAdapter 2.2.7 -> 3.8.3 MSTest.TestFramework 2.2.8 -> 3.8.3 nunit 3.12.0 -> 4.3.2 NUnit3TestAdapter 3.17.0 -> 5.0.0
[1.1.0] - 2025-03-13
Fixed
Fixed bug where regex patterns were not handled correctly in file matching.
[1.0.0] - 2023-02-13
Added
Initial implementation
Last updated
Was this helpful?

