# Variables

Variables allow for the global definition of variables that are available within scripts. You can also import secrets that are also available within scripts or as run as credentials.&#x20;

{% hint style="info" %}
Variables are stored in the `variables.ps1` configuration file.
{% endhint %}

## Creating a Variable&#x20;

To create a variable, navigate to the Automation / Variables page. Click Add Variable to define a new variable.&#x20;

Standard variables are just name \ value pairs of strings. They will be added to your scripts before they are run.&#x20;

!['](/files/-M6k1AMllUz2dGUbC7K0)

## Creating a Secret Variable

{% hint style="warning" %}
Secret management is currently only supported on Windows.&#x20;
{% endhint %}

Secret variables are stored within the selected vault. The value of those variables are never stored within Universal. To define a new secret variable, click Add Variable on the variables page and select the Secret tab.&#x20;

{% hint style="warning" %}
Values for secrets are stored within the current user's Windows Credential Manager instance. If you change users (such as running as a service account), the account will not have access to the previous user's secrets and you will need to add those secrets again.
{% endhint %}

From this dialog, you'll be able to define string and PSCredentials in the specified vault.&#x20;

![](/files/-M6k1XcSDRFDIRPPanJH)

## Importing Secret Variables

You can also import pre-existing secrets as variables into Universal. The variable values are not imported but will be looked up during execution. Click the Import Secret button to import secrets.&#x20;

## Related Cmdlets

* [New-UAVariable](https://github.com/ironmansoftware/universal-docs/blob/master/cmdlets/Universal/New-UAVariable.md)
* [Get-UAVariable](https://github.com/ironmansoftware/universal-docs/blob/master/cmdlets/Universal/Get-UAVariable.md)
* [Remove-UAVariable](https://github.com/ironmansoftware/universal-docs/blob/master/cmdlets/Universal/Remove-UAVariable.md)
* [Set-UAVariable](https://github.com/ironmansoftware/universal-docs/blob/master/cmdlets/Universal/Set-UAVariable.md)


---

# 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.powershelluniversal.com/v1/automation/variables.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.
