> 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/it/comandi-powershell/set-psutrigger.md).

# Set-PSUTrigger

Set-PSUTrigger aggiorna un trigger di automazione esistente in PowerShell Universal, incluso il tipo di evento, lo script, la dashboard e l'ambiente.

## SINOSSI

Aggiorna un trigger di automazione esistente.

## SINTASSI

```powershell
Set-PSUTrigger -Id <Int64> [-Name <String>] [-EventType <EventType>] [-Script <String>] [-Scripts <String[]>] [-TriggerScript <String>] [-Environment <String>] [-Dashboard <String>] [-Parameters <Hashtable>] [<ConnectionOptions>] [<CommonParameters>]
Set-PSUTrigger -Trigger <Trigger> [-Name <String>] [-EventType <EventType>] [-Script <String>] [-Scripts <String[]>] [-TriggerScript <String>] [-Environment <String>] [-Dashboard <String>] [-Parameters <Hashtable>] [<ConnectionOptions>] [<CommonParameters>]
```

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

## DESCRIZIONE

Aggiorna un trigger per ID o per oggetto della pipeline. Cambiano solo i campi indicati. `-Scripts` sostituisce la selezione degli script e supporta più script; `-Script` seleziona invece un solo script. `-Parameters` passa una hashtable allo script di trigger quando viene attivato e risolve i parametri dichiarati di quello script. Un `-Name` vuoto viene rifiutato.

## ESEMPI

```powershell
Set-PSUTrigger -Id 4 -Name 'Server Startup' -EventType ServerStarted
Set-PSUTrigger -Id 4 -Scripts 'Build.ps1','Deploy.ps1' -Parameters @{ Channel = 'ops' }
```

## PARAMETRI

| Parametro                | Descrizione                                                               |
| ------------------------ | ------------------------------------------------------------------------- |
| `-Id`                    | ID numerico del trigger.                                                  |
| `-Trigger`               | Oggetto trigger; accetta l'input della pipeline.                          |
| `-Name`                  | Nuovo nome di trigger non vuoto.                                          |
| `-EventType`             | Tipo di evento che attiva il trigger.                                     |
| `-Script`                | Seleziona uno script associato e cancella la selezione di più script.     |
| `-Scripts`               | Seleziona più script associati e cancella la selezione di un solo script. |
| `-TriggerScript`         | Percorso dello script eseguito quando si verifica l'evento.               |
| `-Environment`           | Ambiente di esecuzione.                                                   |
| `-Dashboard`             | Nome dell'app associata.                                                  |
| `-Parameters`            | Hashtable dei parametri dello script di trigger.                          |
| `-ComputerName`          | URL o nome host del server PSU di destinazione (alias `-Uri`).            |
| `-AppToken`              | Token dell'app dell'API di gestione.                                      |
| `-Credential`            | Credenziali dell'API di gestione.                                         |
| `-UseDefaultCredentials` | Usa le credenziali Windows correnti.                                      |
| `-Integrated`            | Usa il client di gestione nel processo.                                   |
| `-TrustCertificate`      | Ignora gli errori di convalida del certificato.                           |
| `-Cookies`               | Riutilizza i cookie di autenticazione della sessione.                     |

## INPUT

`UniversalAutomation.Trigger`.

## AUTORIZZAZIONI

Il token di accesso richiede `automation.triggers/update` per eseguire questo cmdlet in remoto.


---

# 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/it/comandi-powershell/set-psutrigger.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.
