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

# New-PSUAiTool

New-PSUAiTool enregistre un nouvel outil d'IA reposant sur un script PowerShell dans PowerShell Universal, en l'exposant optionnellement par l'entremise de MCP.

## SYNOPSIS

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

## SYNTAXE

```powershell
New-PSUAiTool -Name <String> -ScriptFullPath <String> [-Description <String>] [-Authenticated] [-Role <String[]>] [-Mcp] [-DefaultMaxWaitTimeoutSeconds <Int32>] [-Environment <String>] [-Computer <String>] [<ConnectionOptions>] [<CommonParameters>]
```

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

## DESCRIPTION

Crée un outil d'IA pris en charge par un script PowerShell. Les agents d'IA peuvent appeler l'outil ; `-Mcp` l'expose aussi par le Model Context Protocol. Les noms d'outils doivent être uniques (sans égard à la casse). `-Environment` et `-Computer` définissent la cible d'exécution par défaut ; un groupe d'ordinateurs peut utiliser `'<GroupName> (All)'` ou `'<GroupName> (Any)'`. L'attente maximale par défaut d'une tâche d'outil est de 30 secondes.

## EXEMPLES

```powershell
New-PSUAiTool -Name GetTickets -Description 'Query ticket data' -ScriptFullPath 'C:\ProgramData\UniversalAutomation\Repository\scripts\GetTickets.ps1' -Authenticated -Role HelpDesk,Admin -Mcp
New-PSUAiTool -Name GetTickets -ScriptFullPath 'C:\Repository\GetTickets.ps1' -Environment '7.4' -Computer 'Agents (Any)' -DefaultMaxWaitTimeoutSeconds 60 -Mcp
```

## PARAMÈTRES

| Paramètre                       | Description                                                                                                                |
| ------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `-Name`                         | Nom d'outil unique obligatoire.                                                                                            |
| `-ScriptFullPath`               | Chemin complet obligatoire du script d'implémentation.                                                                     |
| `-Description`                  | Ce que fait l'outil.                                                                                                       |
| `-Authenticated`                | Requiert une authentification pour exécuter l'outil.                                                                       |
| `-Role`                         | Rôles autorisés à l'exécuter.                                                                                              |
| `-Mcp`                          | Expose l'outil par MCP.                                                                                                    |
| `-DefaultMaxWaitTimeoutSeconds` | Attente maximale par défaut des tâches d'outil, en secondes (30 par défaut) ; les appels individuels peuvent la remplacer. |
| `-Environment`                  | Environnement d'exécution par défaut.                                                                                      |
| `-Computer`                     | Ordinateur ou groupe d'ordinateurs cible par défaut.                                                                       |
| `-ComputerName`                 | URL ou nom d'hôte du serveur PSU cible (alias `-Uri`), et non la cible d'exécution de l'outil.                             |
| `-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.AiTool`.

## PERMISSIONS

Le jeton d'accès requiert `intelligence.tools/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 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/fr/commandes-powershell/new-psuaitool.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.
