> 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/set-psuenvironment.md).

# Set-PSUEnvironment

Set-PSUEnvironment met à jour un environnement d'exécution existant dans PowerShell Universal, identifié par un Id ou un objet de pipeline.

## SYNOPSIS

Met à jour un environnement d'exécution existant.

## SYNTAXE

```powershell
Set-PSUEnvironment -Id <Int64> [-Name <String>] [-Path <String>] [-Arguments <String>] [-Type <EnvironmentType>] [-PowerShellVersion <String>] [-Virtual] [-ContainerImageUrl <String>] [-ContainerImageTag <String>] [-ContainerPull] [-RunspaceSaturationWarningThresholdPercent <Int32>] [-RunspaceSaturationWarningDurationSeconds <Int32>] [<ConnectionOptions>] [<CommonParameters>]
Set-PSUEnvironment -Environment <ExecutionEnvironment> [-Name <String>] [-Path <String>] [-Arguments <String>] [-Type <EnvironmentType>] [-PowerShellVersion <String>] [-Virtual] [-ContainerImageUrl <String>] [-ContainerImageTag <String>] [-ContainerPull] [-RunspaceSaturationWarningThresholdPercent <Int32>] [-RunspaceSaturationWarningDurationSeconds <Int32>] [<ConnectionOptions>] [<CommonParameters>]
```

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

## DESCRIPTION

Met à jour un environnement par ID ou par objet de pipeline. Seuls les champs fournis changent. `-Name` et `-Path`, lorsqu'ils sont précisés, ne doivent pas être vides. Pour `-Type Isolated`, `-PowerShellVersion` accepte les versions installées ou les sélecteurs multi-pwsh (`stable`, `preview`, `lts` ou une version majeure.mineure) ; utilisez `-Virtual` pour un environnement virtuel multi-pwsh géré. Pour les environnements de conteneur, définissez l'URL et l'étiquette de l'image et activez ou désactivez le téléchargement de l'image avec `-ContainerPull`.

## EXEMPLES

```powershell
Set-PSUEnvironment -Id 3 -Name 'PowerShell 7' -Path 'C:\Program Files\PowerShell\7\pwsh.exe'
Set-PSUEnvironment -Id 3 -Type Isolated -PowerShellVersion stable -Virtual
```

## PARAMÈTRES

| Paramètre                                    | Description                                                                                     |
| -------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| `-Id`                                        | ID numérique de l'environnement à mettre à jour.                                                |
| `-Environment`                               | Objet d'environnement à mettre à jour ; accepte l'entrée du pipeline.                           |
| `-Name`                                      | Nouveau nom d'environnement non vide.                                                           |
| `-Path`                                      | Nouveau chemin d'exécutable non vide.                                                           |
| `-Arguments`                                 | Nouveaux arguments de processus.                                                                |
| `-Type`                                      | Type d'environnement (`Custom`, `WindowsPowerShell`, `PowerShell7`, `Isolated` ou `Container`). |
| `-PowerShellVersion`                         | Version installée ou sélecteur multi-pwsh pour les environnements isolés.                       |
| `-Virtual`                                   | Active ou désactive l'utilisation d'un environnement virtuel géré.                              |
| `-ContainerImageUrl`                         | URL de l'image de conteneur.                                                                    |
| `-ContainerImageTag`                         | Étiquette de l'image de conteneur.                                                              |
| `-ContainerPull`                             | Active ou désactive le téléchargement de l'image de conteneur.                                  |
| `-RunspaceSaturationWarningThresholdPercent` | Pourcentage du seuil d'avertissement pour les runspaces saturés.                                |
| `-RunspaceSaturationWarningDurationSeconds`  | Durée de l'avertissement en secondes pour les runspaces saturés.                                |
| `-ComputerName`                              | URL ou nom d'hôte du serveur PSU 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

`PowerShellUniversal.ExecutionEnvironment`.

## PERMISSIONS

Le jeton d'accès requiert `settings.environments/update` 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/set-psuenvironment.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.
