> 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/fr/commandes-powershell/new-psuaiagent.md).

# New-PSUAiAgent

New-PSUAiAgent crée une nouvelle définition d'agent IA dans PowerShell Universal, y compris ses instructions, son modèle, sa clé d'API et ses outils autorisés.

## SYNOPSIS

Crée une nouvelle définition d'agent IA.

## SYNTAXE

```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]`.

## DESCRIPTION

Crée et enregistre un agent d'IA avec les métadonnées du modèle, les instructions, une variable de clé d'API et les outils autorisés. Le fournisseur par défaut est `OpenAI` ; `Anthropic` et `Custom` sont aussi pris en charge. Un fournisseur `Custom` requiert une URL `-Endpoint` absolue. Utilisez `-AvailableInChat` pour exposer l'agent dans les sélecteurs de clavardage de la console d'administration et des applis générées.

## EXEMPLES

```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
```

## PARAMÈTRES

| Paramètre                | Description                                                          |
| ------------------------ | -------------------------------------------------------------------- |
| `-Name`                  | Nom d'agent obligatoire.                                             |
| `-Description`           | Description de l'agent.                                              |
| `-Instructions`          | Instructions système pour l'agent.                                   |
| `-Model`                 | Identificateur de modèle utilisé pour les complétions.               |
| `-ApiKey`                | Variable PSU qui contient la clé d'API du fournisseur.               |
| `-Provider`              | Fournisseur d'IA : `OpenAI` (par défaut), `Anthropic` ou `Custom`.   |
| `-Endpoint`              | URL absolue du fournisseur ; obligatoire lorsque `-Provider Custom`. |
| `-Tool`                  | Noms des outils que l'agent peut appeler (alias `-Tools`).           |
| `-Role`                  | Rôles autorisés à accéder à l'agent (alias `-Roles`).                |
| `-AvailableInChat`       | Rend l'agent sélectionnable dans les sélecteurs de clavardage.       |
| `-ComputerName`          | URL ou nom d'hôte du serveur cible (alias `-Uri`).                   |
| `-AppToken`              | Jeton d'application de l'API de gestion.                             |
| `-Credential`            | Identifiants pour l'authentification de base de l'API de gestion.    |
| `-UseDefaultCredentials` | Utilise les identifiants Windows actuels.                            |
| `-Integrated`            | Utilise le client de gestion dans le processus.                      |
| `-TrustCertificate`      | Ignore les erreurs de validation du certificat.                      |
| `-Cookies`               | Réutilise les témoins d'authentification de la session.              |

## ENTRÉES

Aucune.

## SORTIES

`PowerShellUniversal.Models.Intelligence.AiAgent`.

## PERMISSIONS

Le jeton d'accès requiert `intelligence.agents/create` pour exécuter cette applet de commande à distance.


---

# 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 dynamically by asking a question.

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

```
GET https://docs.devolutions.net/powershell-universal/fr/commandes-powershell/new-psuaiagent.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
