> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/powershell-universal/de/powershell-befehle/new-psuvariable.md).

# New-PSUVariable

New-PSUVariable erstellt eine neue Variable in PowerShell Universal, optional als Geheimnis, Datenbankwert oder auf bestimmte Rollen beschränkt gespeichert.

## SYNOPSIS

Erstellt eine PowerShell Universal-Variable.

## SYNTAX

```powershell
New-PSUVariable -Name <String> [-Value <Object>] [<VariableOptions>] [<ConnectionOptions>]
New-PSUVariable -Name <String> [-InputObject <Object>] [<VariableOptions>] [<ConnectionOptions>]
New-PSUVariable -Name <String> -Vault <String> [-Value <Object>] [-InputObject <Object>] [<VariableOptions>] [<ConnectionOptions>]
```

`<VariableOptions>`: `[-Type <String>] [-Description <String>] [-DisableRunAsSupport] [-Database] [-Required] [-Role <String[]>] [-Force] [-Scope <VariableScope>] [-Tag <Tag[]>] [-PasswordNotRequired]`. `<ConnectionOptions>`: `[-ComputerName <String>] [-AppToken <String>] [-Credential <PSCredential>] [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies]`.

## BESCHREIBUNG

Erstellt eine Variable, die PSU-Skripts zur Verfügung steht. `-InputObject` ohne `-Vault` serialisiert seinen Wert als `PSObject`; im Parametersatz Secret wird `-InputObject` akzeptiert, aber nicht in den gespeicherten `-Value` umgewandelt. Ein über `-Value` angegebenes `PSCredential` speichert Benutzername und Kennwort mit dem Typ `PSCredential`. Vorhandene Variablennamen (ohne Berücksichtigung der Groß-/Kleinschreibung) werden abgelehnt, es sei denn, `-Force` wird angegeben. `-Required` markiert eine Variable als erforderlich. Umgebungsmodulanforderungen können das nutzen, damit ein Modul erst als bereit gilt, wenn die Variable verfügbar ist.

## BEISPIEL

```powershell
New-PSUVariable -Name 'ApiKey' -Required -Description 'API key required by the integration'
```

## PARAMETER

| Parameter                | Beschreibung                                                                           |
| ------------------------ | -------------------------------------------------------------------------------------- |
| `-Name`                  | Erforderlicher eindeutiger Variablenname.                                              |
| `-Value`                 | Zu speichernder Wert; Zeichenfolgenwerte können aus CLIXML deserialisiert werden.      |
| `-InputObject`           | Als `PSObject` serialisiertes Objekt nur im Parametersatz InputObject (ohne `-Vault`). |
| `-Vault`                 | Name des Geheimnistresors für den Parametersatz Secret.                                |
| `-Type`                  | Variablentyp, standardmäßig `System.String`, wenn kein Wert ihn überschreibt.          |
| `-Description`           | Beschreibung der Variablen.                                                            |
| `-DisableRunAsSupport`   | Deaktiviert die Verwendung als Run-As-Anmeldeinformation.                              |
| `-Database`              | Speichert den Wert in der Datenbank.                                                   |
| `-Required`              | Markiert die Variable als erforderlich.                                                |
| `-Role`                  | Rollen, die auf die Variable zugreifen dürfen.                                         |
| `-Force`                 | Erlaubt die Erstellung, wenn der Name bereits vorhanden ist.                           |
| `-Scope`                 | Gültigkeitsbereich der Variablen.                                                      |
| `-Tag`                   | Tags für die Variable.                                                                 |
| `-PasswordNotRequired`   | Markiert das Kennwort einer Anmeldeinformation als nicht erforderlich.                 |
| `-ComputerName`          | URL oder Hostname des Ziel-PSU-Servers (Alias `-Uri`).                                 |
| `-AppToken`              | App-Token der Verwaltungs-API.                                                         |
| `-Credential`            | Anmeldeinformationen der Verwaltungs-API.                                              |
| `-UseDefaultCredentials` | Verwendet die aktuellen Windows-Anmeldeinformationen.                                  |
| `-Integrated`            | Verwendet den prozessinternen Verwaltungsclient.                                       |
| `-TrustCertificate`      | Ignoriert Fehler bei der Zertifikatsvalidierung.                                       |
| `-Cookies`               | Verwendet die Authentifizierungscookies der Sitzung erneut.                            |

## BERECHTIGUNGEN

Das Zugriffstoken erfordert `platform.variables/create`, um dieses Cmdlet remote auszuführen.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.devolutions.net/powershell-universal/de/powershell-befehle/new-psuvariable.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
