> 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/es/comandos-de-powershell/invoke-psutest.md).

# Invoke-PSUTest

Ejecuta un fichero o una carpeta de pruebas Pester de PowerShell Universal y, opcionalmente, espera y devuelve sus resultados.

## SYNOPSIS

Inicia una ejecución de pruebas Pester en PowerShell Universal.

## SYNTAX

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

Pase un objeto `TestFile` desde las API de pruebas con `-TestFile` en lugar de `-Path`. Ambos conjuntos de parámetros admiten `-ComputerName`, `-AppToken`, `-UseDefaultCredentials`, `-Integrated`, `-TrustCertificate` y `-Cookies`.

## DESCRIPTION

`Invoke-PSUTest` inicia una ejecución de pruebas Pester y devuelve el registro de la ejecución creada. Utilice los filtros de etiqueta y de nombre de prueba para seleccionar las pruebas. `-Wait` espera a que finalice; `-IncludeSuite` añade la suite analizada al objeto devuelto.

## EXAMPLES

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

## PARAMETERS

| Parámetro              | Descripción                                                                                                          |
| ---------------------- | -------------------------------------------------------------------------------------------------------------------- |
| `-Path`                | Fichero o carpeta de pruebas que se va a ejecutar.                                                                   |
| `-TestFile`            | Objeto de fichero de pruebas que se va a ejecutar; acepta entrada de canalización.                                   |
| `-Environment`         | Entorno de ejecución para la ejecución de pruebas.                                                                   |
| `-Tag` / `-ExcludeTag` | Incluye o excluye pruebas según la etiqueta de Pester.                                                               |
| `-Test`                | Filtro de nombre completo de Pester.                                                                                 |
| `-Wait`                | Espera a que finalice antes de devolver el resultado.                                                                |
| `-Timeout`             | Tiempo de espera en segundos; el valor predeterminado es 300. Establézcalo en `0` para que no haya tiempo de espera. |
| `-IncludeSuite`        | Devuelve un objeto con `TestRun` y `TestSuite` una vez finalizada la ejecución.                                      |

## OUTPUTS

`PowerShellUniversal.Models.Testing.TestRun`, o un `PSCustomObject` que contiene la ejecución y la suite cuando se utiliza `-IncludeSuite`.


---

# 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/es/comandos-de-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.
