> 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 PowerShell di aggiornamento automatico per Devolutions 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 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/it/devolutions-gateway-powershell/powershell-auto-updater-script-for-devolutions-gateway.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.
