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

Passez un objet `TestFile` provenant des API de test avec `-TestFile` au lieu de `-Path`. Les deux jeux de paramètres prennent en charge `-ComputerName`, `-AppToken`, `-UseDefaultCredentials`, `-Integrated`, `-TrustCertificate` et `-Cookies`.

## DESCRIPTION

`Invoke-PSUTest` démarre une exécution de tests Pester et retourne l'enregistrement de l'exécution de tests créé. Utilisez les filtres par étiquette et par nom de test pour cibler des tests. `-Wait` attend la fin de l'exécution; `-IncludeSuite` ajoute la suite analysée à l'objet retourné.

## 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`                | Fichier ou dossier de test à exécuter.                                                               |
| `-TestFile`            | Objet fichier de test à exécuter; accepte l'entrée du pipeline.                                      |
| `-Environment`         | Environnement d'exécution pour l'exécution de tests.                                                 |
| `-Tag` / `-ExcludeTag` | Inclut ou exclut des tests selon l'étiquette Pester.                                                 |
| `-Test`                | Filtre par nom complet Pester.                                                                       |
| `-Wait`                | Attend la fin de l'exécution avant de retourner.                                                     |
| `-Timeout`             | Délai d'attente en secondes; la valeur par défaut est 300. Définir à `0` pour aucun délai d'attente. |
| `-IncludeSuite`        | Retourne un objet contenant `TestRun` et `TestSuite` une fois l'exécution terminée.                  |

## SORTIES

`PowerShellUniversal.Models.Testing.TestRun`, ou un `PSCustomObject` contenant l'exécution et la suite lorsque `-IncludeSuite` est utilisé.


---

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