> 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-psuaiagent.md).

# New-PSUAiAgent

New-PSUAiAgent erstellt eine neue KI-Agenten-Definition in PowerShell Universal, einschließlich ihrer Anweisungen, des Modells, des API-Schlüssels und der zulässigen Tools.

## SYNOPSIS

Erstellt eine neue KI-Agenten-Definition.

## SYNTAX

```powershell
New-PSUAiAgent -Name <String> [-Description <String>] [-Instructions <String>] [-Model <String>] [-ApiKey <Variable>] [-Provider <AiProvider>] [-Endpoint <String>] [-Tool <String[]>] [-Role <String[]>] [-AvailableInChat] [<ConnectionOptions>] [<CommonParameters>]
```

`<ConnectionOptions>`: `[-ComputerName <String>] [-AppToken <String>] [-Credential <PSCredential>] [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies]`.

## BESCHREIBUNG

Erstellt einen KI-Agenten und speichert ihn mit Modellmetadaten, Anweisungen, einer API-Schlüsselvariable und zulässigen Tools. Der Anbieter ist standardmäßig `OpenAI`; `Anthropic` und `Custom` werden ebenfalls unterstützt. Ein `Custom`-Anbieter erfordert eine absolute `-Endpoint`-URL. Verwenden Sie `-AvailableInChat`, um den Agenten in den Chat-Auswahllisten der Verwaltungskonsole und generierter Apps anzuzeigen.

## BEISPIELE

```powershell
New-PSUAiAgent -Name SupportAgent -Description 'Tier 1 assistant' -Instructions 'Answer from the knowledge base first.' -Model gpt-4o-mini -Tool GetUsers,GetTickets
New-PSUAiAgent -Name SupportAgent -Model gpt-4o-mini -Instructions 'Answer from the knowledge base first.' -Tool GetTickets -AvailableInChat
```

## PARAMETER

| Parameter                | Beschreibung                                                              |
| ------------------------ | ------------------------------------------------------------------------- |
| `-Name`                  | Erforderlicher Agentenname.                                               |
| `-Description`           | Beschreibung des Agenten.                                                 |
| `-Instructions`          | Systemanweisungen für den Agenten.                                        |
| `-Model`                 | Für Vervollständigungen verwendete Modellkennung.                         |
| `-ApiKey`                | PSU-Variable, die den API-Schlüssel des Anbieters enthält.                |
| `-Provider`              | KI-Anbieter: `OpenAI` (Standard), `Anthropic` oder `Custom`.              |
| `-Endpoint`              | Absolute Anbieter-URL; erforderlich, wenn `-Provider Custom`.             |
| `-Tool`                  | Namen der Tools, die der Agent aufrufen darf (Alias `-Tools`).            |
| `-Role`                  | Rollen, die auf den Agenten zugreifen dürfen (Alias `-Roles`).            |
| `-AvailableInChat`       | Macht den Agenten in Chat-Auswahllisten auswählbar.                       |
| `-ComputerName`          | URL oder Hostname des Zielservers (Alias `-Uri`).                         |
| `-AppToken`              | App-Token der Verwaltungs-API.                                            |
| `-Credential`            | Anmeldeinformationen für die Basic-Authentifizierung 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.               |

## EINGABEN

Keine.

## AUSGABEN

`PowerShellUniversal.Models.Intelligence.AiAgent`.

## BERECHTIGUNGEN

Das Zugriffstoken erfordert `intelligence.agents/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-psuaiagent.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.
