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

Find

Find files from directory.

Task version: 2.1.0

Required Frends version: 5.7+

Required .NET version: 8.0

Compatible Agents: Crossplatform

Task Parameters

Name
Description

Directory : String

Root directory where the pattern matching should start

Default: "c:" Example: C:\directory</code>

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

Name
Description

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

ThrowErrorOnFailure : Boolean

Whether to throw an error on failure.

Default: True Example: true

ErrorMessageOnFailure : String

Overrides the error message on failure.

Default: - Example: File discovery failed

Task Result

Name
Description

Success : Boolean

Indicates whether the operation completed successfully. Example: true

Error : Error

Error details. Null when Success is true. Example: null

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 }

Files : List<FileItem>

List of files found from directory. Example: List [object { string Extension, string DirectoryName, string FullPath, string FileName, bool IsReadOnly, double SizeInMegaBytes, DateTime CreationTime, DateTime CreationTimeUtc, DateTime LastAccessTime, DateTime LastAccessTimeUtc, DateTime LastWriteTime, DateTime LastWriteTimeUtc }]

Task Changelog

Changelog for Task Frends.Files.Find.

[2.1.0] - 2026-10-05

Changed

  • Expanded the result with Success and Error fields to report whether file discovery succeeded and provide failure details.

  • Added ThrowErrorOnFailure and ErrorMessageOnFailure options to choose whether failures are returned in the result or thrown, and to set a custom failure message.

  • Added cancellation token support to stop file discovery when cancellation is requested before it starts.

[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.1.0] - 2025-03-19

Changed

  • Update packages: Microsoft.Extensions.FileSystemGlobbing 7.0.0 -> 9.0.3 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.0.1] - 2023-12-13

Changed

  • Result documentation updated

[1.0.0] - 2023-03-07

Added

  • Initial implementation

Last updated

Was this helpful?