> 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

Ce script PowerShell est conçu pour être enregistré en tant que tâche planifiée qui s'exécute une fois par jour afin de vérifier les mises à jour, les télécharger puis les installer. Ce script est particulièrement utile lorsque vous utilisez plusieurs passerelles, car il permet de gagner 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 élévation de privilèges.
3. Accédez au répertoire contenant le script GatewayUpdater.ps1.
4. Exécutez-le à l'aide du 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écute chaque jour à 3h00. Elle peut également être déclenchée manuellement à l'aide de la commande suivante : `& schtasks.exe /Run /TN "Devolutions Gateway Updater"`\
Il est ensuite possible d'interroger l'état de la tâche planifiée :

```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" %}
Le programme de mise à jour télécharge automatiquement le programme d'installation si une nouvelle version est disponible, puis vérifie le hachage du fichier avant de l'exécuter silencieusement.
{% endhint %}

### Désinstallation

{% hint style="info" %}
Cette opération désenregistre la tâche planifiée et supprime 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.devolutions.net/powershell/fr/devolutions-gateway-powershell/powershell-auto-updater-script-for-devolutions-gateway.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
