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

# Script di aggiornamento automatico PowerShell per Devolutions Gateway

Installi un'attività pianificata PowerShell che verifica, scarica e installa automaticamente gli aggiornamenti di Devolutions Gateway su più gateway.

Questo script PowerShell è pensato per essere registrato come attività pianificata che viene eseguita una volta al giorno per verificare la presenza di aggiornamenti, scaricarli e quindi installarli. Questo script è particolarmente utile quando si utilizzano più gateway, poiché consente di risparmiare molto tempo.

{% hint style="info" %}
Legga questa pagina [GitHub](https://github.com/Devolutions/devolutions-gateway/blob/master/tools/updater/README.md) per maggiori dettagli.
{% endhint %}

### Installazione

1. Scarichi lo [script PowerShell](https://github.com/Devolutions/devolutions-gateway/blob/master/tools/updater/GatewayUpdater.ps1) di aggiornamento automatico.
2. Apra un terminale PowerShell con privilegi elevati.
3. Si sposti nella directory contenente lo script GatewayUpdater.ps1.
4. Lo esegua utilizzando il parametro `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
```

### Esecuzione

Per impostazione predefinita, l'attività pianificata viene eseguita ogni giorno alle 3:00. Può inoltre essere attivata manualmente utilizzando il seguente comando: `& schtasks.exe /Run /TN "Devolutions Gateway Updater"`\
Lo stato dell'attività pianificata può quindi essere interrogato:

```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'updater scarica automaticamente il programma di installazione se è disponibile una nuova versione, quindi verifica l'hash del file prima di eseguirlo in modalità silenziosa.
{% endhint %}

### Disinstallazione

{% hint style="info" %}
Questo annullerà la registrazione dell'attività pianificata ed eliminerà lo script GatewayUpdater.ps1 dal percorso utilizzato nel comando.
{% endhint %}

1. Apra un terminale PowerShell.
2. Esegua lo script GatewayUpdater.ps1 con il parametro `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/it/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.
