# CreateDirectory

Required Frends version: 5.7+

Required .NET version: 8.0

Compatible Agents: Unknown

Source code: <https://github.com/FrendsPlatform/Frends.Smb/tree/main/Frends.Smb.CreateDirectory>

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

| Name                         | Description                                                                                                                                                                                                |
| ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| DirectoryPath : `PathString` | <p>Full path to the directory (relative to the share) we want to create. If a folder already exists, nothing happens.</p><p><br>Default: <code>-</code><br>Example: <code>root\folder\newFolder</code></p> |
| {% endtab %}                 |                                                                                                                                                                                                            |

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

| Name                   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Server : `String`      | <p>SMB server address or hostname.</p><p><br>Default: <code>-</code><br>Example: <code>127.0.0.1</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Share : `String`       | <p>SMB share name to connect to.</p><p><br>Default: <code>-</code><br>Example: <code>testShare</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                           |
| Username : `String`    | <p>Username for SMB authentication.</p><p>This needs to be of format domain\username</p><p><br>Default: <code>-</code><br>Example: <code>WORKGROUP\Administrator</code></p>                                                                                                                                                                                                                                                                                                                                                         |
| 🗝Password : `String`  | <p>Password for the SMB credentials.</p><p><br>Default: <code>-</code><br>Example: <code>Password123</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                     |
| OperatingSystem : `Os` | <p>Defines the operating system of the SMB server.</p><p>Options used to determine correct path separator to use.</p><p>Possible values:</p><ul><li><code>Windows</code>:</li></ul><p>Defines the operating system of the SMB server.</p><p>Options used to determine correct path separator to use.</p><ul><li><code>Linux</code>:</li></ul><p>Defines the operating system of the SMB server.</p><p>Options used to determine correct path separator to use.</p><p><br>Default: <code>2</code><br>Example: <code>Linux</code></p> |
| {% endtab %}           |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |

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

| Name                             | Description                                                                                                                    |
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| ThrowErrorOnFailure : `Boolean`  | <p>Whether to throw an error on failure.</p><p><br>Default: <code>True</code><br>Example: <code>false</code></p>               |
| ErrorMessageOnFailure : `String` | <p>Overrides the error message on failure.</p><p><br>Default: <code>-</code><br>Example: <code>Custom error message</code></p> |
| {% endtab %}                     |                                                                                                                                |

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

| Name                       | Description                                                                                                                    |
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| Success : `Boolean`        | <p>Indicates if the task completed successfully.<br>Example: <code>true</code></p>                                             |
| FullUncPath : `PathString` | <p>Full path of the created directory.<br>Example: <code>\host\share\dir\newDir</code></p>                                     |
| Error : `Error`            | <p>Error that occurred during task execution.<br>Example: <code>object { string Message, Exception AdditionalInfo }</code></p> |
| {% endtab %}               |                                                                                                                                |

{% tab title="Changelog" %}

## Changelog

### \[2.0.0] - 2026-04-08

#### Added

* New connection parameters that defined what servers Operating System.
* \[Breaking Change] Introduce PathString type that will represent paths with OS specific separators.

### \[1.0.0] - 2025-11-13

#### Added

* Initial implementation
  {% endtab %}
  {% endtabs %}
