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

Move

Move files.

Task version: 3.0.0

Required Frends version: 5.7+

Required .NET version: 8.0

Compatible Agents: Crossplatform

Task Parameters

Name
Description

SourceDirectory : String

Source directory.

Default: - Example: c:\temp

Pattern : String

Pattern to match relative to SourceDirectory. 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

TargetDirectory : String

Target directory where the found files should be copied to

Default: "d:\backup" Example: \183.169.59.122\Shared\dst

Name
Description

SourceIsRemote : Boolean

Defines if the source path is on a remote host.

Note: This feature is only possible with Windows agents.

Default: False Example: false

SourceUserName : String

Username used to connect with remote source

NOTE: This needs to be of format domain\username

Default: "domain\username" Example: WORKGROUP\John

🗝SourcePassword : String

Password for the used credentials.

Default: - Example: test

TargetIsRemote : Boolean

Defines if the target path is on a remote host.

Note: This feature is only possible with Windows agents.

Default: False Example: false

TargetUserName : String

Username used to connect with remote target

NOTE: This needs to be of format domain\username

Default: "domain\username" Example: WORKGROUP\John

🗝TargetPassword : String

Password for the used credentials.

Default: - Example: test

Name
Description

ThrowErrorOnFailure : Boolean

Whether to throw an error on failure.

Default: True Example: true

ErrorMessageOnFailure : String

Overrides the error message on failure.

Default: - Example: Custom error message

PreserveDirectoryStructure : Boolean

If set, will recreate the directory structure from the SourceDirectory under the DestinationDirectory for copied files

Default: False Example: true

CreateTargetDirectories : Boolean

If set, will create the target directory if it does not exist,

as well as any subdirectories if PreserveDirectoryStructure is set.

Default: True Example: true

IfTargetFileExists : FileExistsAction

What should happen if a file with the same name already exists in the target directory.

* Throw - Throw an error and roll back all transfers

* Overwrite - Overwrites the target file

* Rename - Renames the transferred file by appending a number to the end

Possible values:

  • Throw: Throw an error and roll back all transfers.

  • Overwrite: Overwrite the target file.

  • Rename: Rename the transferred file by appending a number to the end.

Default: Throw Example: FileExistsAction.Overwrite

Task Result

Name
Description

Success : Boolean

Indicates if the task completed successfully. Example: true

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 source directory.

Error.AdditionalInfo : Exception

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

Files : List<FileItem>

List of FileItem objects with source path and target path attributes. Example: [object {SourcePath: C:\test\testfolder\test1.txt, TargetPath: C:\test\moved\test1.txt}, object {SourcePath: C:\test\testfolder\test2.txt, TargetPath: C:\test\moved\test2.txt}]

Task Changelog

Changelog for Task Frends.Files.Move.

[3.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 SourceDirectory, separators are normalized to /, matching is case-insensitive, glob mode supports * and **, and <regex> enables regex evaluation against the relative path and file name.

[2.0.0] - 2025-10-14

Fixed

  • Fixed issue with impersonation when moving files between remote places.

  • Fixed issue with PreserveDirectoryStructure when regex patterns were used.

Changed

  • Added options to handle errors

  • Add Success and Error parameters to Result object

  • Upgrade target framework to net8.0

    Breaking Changes

    • Moved parameters related to impersonation to new Connection tab

    • Renamed input Directory to SourceDirectory

[1.4.0] - 2025-08-12

Changed

  • Refactor ExecuteAction to run synchronously for impersonated calls.

[1.3.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.2.0] - 2025-03-13

Fixed

  • Fixed bug where regex patterns were not handled correctly in file matching.

[1.1.0] - 2024-11-1

Fixed

  • Fixed issue with Task not working with impersonation by removing the source file in the main method.

[1.0.0] - 2023-02-14

Added

  • Initial implementation

Last updated

Was this helpful?