> 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/fr/devolutions-gateway-powershell/powershell-auto-updater-script-for-devolutions-gateway.md).

# Script de mise à jour automatique PowerShell pour Devolutions Gateway

Installez une tâche planifiée PowerShell qui vérifie, télécharge et installe automatiquement les mises à jour de Devolutions Gateway sur plusieurs gateways.

Ce script PowerShell est conçu pour être enregistré comme tâche planifiée qui s'exécute une fois par jour afin de vérifier la présence de mises à jour, de les télécharger puis de les installer. Ce script est particulièrement utile lorsque plusieurs gateways sont utilisés, car il permet d'économiser beaucoup de temps.

{% hint style="info" %}
Consultez cette page [GitHub](https://github.com/Devolutions/devolutions-gateway/blob/master/tools/updater/README.md) pour plus de détails.
{% endhint %}

### Installation

1. Téléchargez le [script PowerShell](https://github.com/Devolutions/devolutions-gateway/blob/master/tools/updater/GatewayUpdater.ps1) de mise à jour automatique.
2. Ouvrez un terminal PowerShell avec des privilèges élevés.
3. Déplacez-vous vers le répertoire contenant le script GatewayUpdater.ps1.
4. Exécutez-le en utilisant le paramètre `install`.

```powershell
PS > .\GatewayUpdater.ps1 install

TaskPath                                       TaskName                          State
--------                                       --------                          -----
\                                              Devolutions Gateway Updater       Ready
Updater script installed to 'C:\Program Files\Devolutions\Gateway Updater\GatewayUpdater.ps1' and registered as 'Devolutions Gateway Updater' scheduled task
```

### Exécution

Par défaut, la tâche planifiée s'exécutera chaque jour à 3 h. Elle peut aussi être déclenchée manuellement à l'aide de la commande suivante : `& schtasks.exe /Run /TN "Devolutions Gateway Updater"`\
L'état de la tâche planifiée peut ensuite être interrogé :

```powershell
PS > schtasks.exe /Query /TN "Devolutions Gateway Updater"

Folder: \
TaskName                                 Next Run Time          Status
======================================== ====================== ===============
Devolutions Gateway Updater              Date     3:00:00 AM    Ready
```

{% hint style="info" %}
L'outil de mise à jour télécharge automatiquement l'installateur si une nouvelle version est disponible, puis vérifie le hachage du fichier avant de l'exécuter en mode silencieux.
{% endhint %}

### Désinstallation

{% hint style="info" %}
Cela désenregistrera la tâche planifiée et supprimera le script GatewayUpdater.ps1 du chemin utilisé dans la commande.
{% endhint %}

1. Ouvrez un terminal PowerShell.
2. Exécutez le script GatewayUpdater.ps1 avec le paramètre `uninstall`.

```powershell
PS > .\GatewayUpdater.ps1 uninstall

Folder: \
TaskName                                 Next Run Time          Status
======================================== ====================== ===============
Devolutions Gateway Updater              Date     3:00:00 AM    Ready
SUCCESS: The scheduled task "Devolutions Gateway Updater" was successfully deleted.
```


---

# 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/fr/devolutions-gateway-powershell/powershell-auto-updater-script-for-devolutions-gateway.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.
