> 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/invoke-psutest.md).

# Invoke-PSUTest

Exécuter un fichier ou un dossier de tests Pester PowerShell Universal et, facultativement, attendre et retourner ses résultats.

## SYNOPSIS

Démarre une exécution de tests Pester dans PowerShell Universal.

## SYNTAXE

```powershell
Invoke-PSUTest -Path <String> [-Environment <String>] [-Tag <String[]>] [-ExcludeTag <String[]>] [-Test <String[]>] [-Wait] [-Timeout <Int32>] [-IncludeSuite] [<ConnectionOptions>] [<CommonParameters>]
Invoke-PSUTest -TestFile <TestFile> [-Environment <String>] [-Tag <String[]>] [-ExcludeTag <String[]>] [-Test <String[]>] [-Wait] [-Timeout <Int32>] [-IncludeSuite] [<ConnectionOptions>] [<CommonParameters>]
```

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

## DESCRIPTION

Démarre une exécution de tests Pester et retourne un enregistrement d'exécution de tests. Utilisez les filtres d'étiquette et de nom de test pour cibler les tests. `-Wait` interroge jusqu'à la fin ; `-Timeout` est de 300 secondes par défaut et `0` désactive le délai d'attente. `-IncludeSuite` retourne un objet qui contient `TestRun` et `TestSuite` (avec ou sans `-Wait`).

## EXEMPLES

```powershell
Invoke-PSUTest -Path '.\tests\api.tests.ps1'
Invoke-PSUTest -Path '.\tests\api.tests.ps1' -Tag Smoke -ExcludeTag Slow
Invoke-PSUTest -Path '.\tests\api.tests.ps1' -Test 'API returns 200'
Invoke-PSUTest -Path '.\tests\api.tests.ps1' -Wait -IncludeSuite
```

## PARAMÈTRES

| Paramètre                | Description                                                                                        |
| ------------------------ | -------------------------------------------------------------------------------------------------- |
| `-Path`                  | Chemin obligatoire du fichier ou du dossier de tests (jeu de paramètres Path).                     |
| `-TestFile`              | Objet de fichier de tests obligatoire ; accepte l'entrée du pipeline (jeu de paramètres TestFile). |
| `-Environment`           | Environnement d'exécution pour l'exécution de tests.                                               |
| `-Tag`                   | Inclut les tests qui ont ces étiquettes Pester (alias `-TagFilter`).                               |
| `-ExcludeTag`            | Exclut les tests qui ont ces étiquettes (alias `-ExcludeTagFilter`).                               |
| `-Test`                  | Filtres de nom complet Pester (alias `-FullName`, `-FullNameFilter`, `-Tests`).                    |
| `-Wait`                  | Attend la fin de l'exécution avant de retourner.                                                   |
| `-Timeout`               | Délai d'attente en secondes, 300 par défaut ; `0` le désactive.                                    |
| `-IncludeSuite`          | Retourne à la fois l'exécution de tests et la suite analysée.                                      |
| `-ComputerName`          | URL ou nom d'hôte de l'API de gestion PSU (alias `-Uri`).                                          |
| `-AppToken`              | Jeton d'application de l'API de gestion.                                                           |
| `-Credential`            | Identifiants 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.                                            |

## SORTIES

`PowerShellUniversal.Models.Testing.TestRun`, ou un objet qui contient `TestRun` et `TestSuite` lorsque `-IncludeSuite` est précisé.

## PERMISSIONS

Le jeton d'accès requiert `automation.tests/execute` 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/invoke-psutest.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.
