# MoveDirectory

Required Frends version: 5.5+

Required .NET version: 6.0

Compatible Agents: Crossplatform

Source code: <https://github.com/FrendsPlatform/Frends.Files/tree/main/Frends.Files.MoveDirectory>

{% tabs %}
{% tab title="Parameter: Input" %}

| Name                       | Description                                                                                              |
| -------------------------- | -------------------------------------------------------------------------------------------------------- |
| SourceDirectory : `String` | <p>Source Directory path.</p><p><br>Default: <code>"c:\temp"</code><br>Example: <code>C:\Temp</code></p> |
| TargetDirectory : `String` | <p>Target Directory path.</p><p><br>Default: <code>"c:\temp"</code><br>Example: <code>C:\Temp</code></p> |
| {% endtab %}               |                                                                                                          |

{% tab title="Parameter: Options" %}

| Name                                                    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| IfTargetDirectoryExists : `DirectoryExistsAction`       | <p>What to do if target directory already exists.</p><p>\* Throw - Throw an error (the default)</p><p>\* Rename - Create a new directory with a name that appends a number to the end, e.g. "directory(2)"</p><p>\* Overwrite - Overwrite the target directory, by removing it first before moving the source directory</p><p>Possible values:</p><ul><li><code>Throw</code>:</li></ul><p>What to do if target directory already exists.</p><p>\* Throw - Throw an error (the default)</p><p>\* Rename - Create a new directory with a name that appends a number to the end, e.g. "directory(2)"</p><p>\* Overwrite - Overwrite the target directory, by removing it first before moving the source directory</p><ul><li><code>Overwrite</code>:</li></ul><p>What to do if target directory already exists.</p><p>\* Throw - Throw an error (the default)</p><p>\* Rename - Create a new directory with a name that appends a number to the end, e.g. "directory(2)"</p><p>\* Overwrite - Overwrite the target directory, by removing it first before moving the source directory</p><ul><li><code>Rename</code>:</li></ul><p>What to do if target directory already exists.</p><p>\* Throw - Throw an error (the default)</p><p>\* Rename - Create a new directory with a name that appends a number to the end, e.g. "directory(2)"</p><p>\* Overwrite - Overwrite the target directory, by removing it first before moving the source directory</p><p><br>Default: <code>-</code><br>Example: <code>Throw</code></p> |
| UseGivenUserCredentialsForRemoteConnections : `Boolean` | <p>If set, allows you to give the user credentials to use to create directories on remote hosts.</p><p>If not set, the agent service user credentials will be used.</p><p>Note: For creating directories on the local machine, the agent service user credentials will always be used, even if this option is set.</p><p><br>Default: <code>-</code><br>Example: <code>true</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| UserName : `String`                                     | <p>This needs to be of format domain\username</p><p><br>Default: <code>"domain\username"</code><br>Example: <code>Domain\Username</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| 🗝Password : `String`                                   | <p>Password of user</p><p><br>Default: <code>-</code><br>Example: <code>Password123</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| {% endtab %}                                            |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |

{% tab title="Result: Result" %}

| Name                  | Description                                                                      |
| --------------------- | -------------------------------------------------------------------------------- |
| SourcePath : `String` | <p>Source path of directory<br>Example: <code>C:/User/SourceDirectory</code></p> |
| TargetPath : `String` | <p>Target path of directory<br>Example: <code>C:/User/TargetDirectory</code></p> |
| {% endtab %}          |                                                                                  |

{% tab title="Changelog" %}

## Changelog

### \[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-08-17

#### Added

* Initial implementation of Frends.Files.MoveDirectory.
  {% endtab %}
  {% endtabs %}
