# Data Types

## Basic Data Types

* **\[string]** — a string used to represent text.
* **\[char]** — a 16-bit character in Unicode format, used to represent individual characters.
* **\[byte]** — an 8-bit numeric type, typically used for handling binary data.
* **\[int]** — a 32-bit integer, a common type for working with integer values.
* **\[long]** — a 64-bit integer, used for large integer values.
* **\[bool]** — a boolean type that accepts True or False values, used for logical operations.
* **\[decimal]** — a 128-bit floating-point number, optimal for financial calculations with high precision.
* **\[single]** — a 32-bit floating-point number.
* **\[double]** — a 64-bit floating-point number, well-suited for scientific and engineering calculations.
* **\[DateTime]** — a data type for storing date and time.
* **\[xml]** — an object for working with XML data.
* **\[array] \[string\[]]** — an array, can be created with examples: `@(1,2,3)` or simply `(1,2,3)`. It is important to remember that `(1)` is not an array, but a scalar value. Arrays allow storing sets of elements of the same or different data types. More information can be found in the official documentation on arrays:

{% embed url="<https://learn.microsoft.com/en-us/powershell/scripting/learn/deep-dives/everything-about-arrays?view=powershell-7.5&viewFallbackFrom=powershell-7.1>" %}

* **\[hashtable]** — a hash table or dictionary with keys and values, for example: `@{1=11; 2=12; 3=14}`. It is convenient for associative data storage. More about hash tables can be read in the reference materials:

{% embed url="<https://learn.microsoft.com/en-us/powershell/scripting/learn/deep-dives/everything-about-hashtable?view=powershell-7.5&viewFallbackFrom=powershell-7.1>" %}

## Type Conversion

* Converting a string value to a date:

```
powershell"5/7/07" -as [DateTime]
```

* Alternative conversion using type casting:

```
powershell[datetime]"5/7/07"
```

* Using a method from the Convert class:

```
powershell[Convert]::ToDateTime("5/7/07")
```

* Example of converting a numeric expression to a string:

```
powershell(1 + 1 * 2).ToString()
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sherparpa.ru/en/sherpa-rpa/sherpa-designer/sherpa-designer-otvety-na-chasto-zadavaemye-voprosy/powershell/tipy-dannykh.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
