> 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/send-psuevent.md).

# Send-PSUEvent

Send-PSUEvent invia dati di evento o comandi remoti a una connessione di hub eventi o a una sessione di computer connessa.

## SINOSSI

Invia dati o comandi a un hub eventi, a un computer o a un gruppo di computer.

## SINTASSI

```powershell
Send-PSUEvent -Hub <String> [-ConnectionId <String>] [-Data <Object>] [-Timeout <Int32>] [-ComputerName <String>] [-AppToken <String>] [-Credential <PSCredential>] [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies]
Send-PSUEvent -Hub <String> [-ConnectionId <String>] [-Command <String>] [-Parameters <Hashtable>] [-Timeout <Int32>] [-ComputerName <String>] [-AppToken <String>] [-Credential <PSCredential>] [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies]
Send-PSUEvent -Computer <String> [-Data <Object>] [-ScriptBlock <ScriptBlock>] [-Timeout <Int32>] [-ComputerName <String>] [-AppToken <String>] [-Credential <PSCredential>] [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies]
Send-PSUEvent -Computer <String> [-Command <String>] [-Parameters <Hashtable>] [-Timeout <Int32>] [-ComputerName <String>] [-AppToken <String>] [-Credential <PSCredential>] [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies]
Send-PSUEvent -ComputerGroup <String> [-Data <Object>] [-ScriptBlock <ScriptBlock>] [-Timeout <Int32>] [-ComputerName <String>] [-AppToken <String>] [-Credential <PSCredential>] [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies]
Send-PSUEvent -ComputerGroup <String> [-Command <String>] [-Parameters <Hashtable>] [-Timeout <Int32>] [-ComputerName <String>] [-AppToken <String>] [-Credential <PSCredential>] [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies]
```

## DESCRIZIONE

Invia dati serializzati o richiede l'esecuzione di un comando sugli agenti connessi. Selezioni un hub eventi con `-Hub`, un agente con `-Computer` o un gruppo con `-ComputerGroup`. Per un agente, usi `-ScriptBlock` per una chiamata di script oppure `-Command` e `-Parameters` per un comando di modulo; queste opzioni appartengono a set di parametri diversi. `-Timeout` è di 30 secondi per impostazione predefinita. `Invoke-PSUCommand` è un alias.

## ESEMPI

```powershell
Send-PSUEvent -Hub 'MyHub' -Data @{ Name = 'Adam' }
Send-PSUEvent -ComputerGroup 'Build agents' -Command 'Get-Process' -Parameters @{ Name = 'pwsh' } -Timeout 30
```

## PARAMETRI

| Parametro                | Descrizione                                                                                                         |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------- |
| `-Hub`                   | Nome dell'hub eventi; i dati dell'evento vanno a tutte le connessioni, a meno che non sia indicato `-ConnectionId`. |
| `-ConnectionId`          | Invia a una connessione specifica dell'hub.                                                                         |
| `-Computer`              | Ha come destinazione un computer connesso.                                                                          |
| `-ComputerGroup`         | Ha come destinazione un gruppo di computer connessi.                                                                |
| `-Data`                  | Oggetto da serializzare e inviare a un hub o a un computer.                                                         |
| `-ScriptBlock`           | Script da eseguire su un computer o su un gruppo di computer.                                                       |
| `-Command`               | Comando di modulo da eseguire su un computer, un gruppo o un hub.                                                   |
| `-Parameters`            | Hashtable dei parametri passati a `-Command`.                                                                       |
| `-Timeout`               | Tempo di attesa del risultato, in secondi; il valore predefinito è 30.                                              |
| `-ComputerName`          | URL del server PSU per una connessione di gestione remota; alias: `-Uri`.                                           |
| `-AppToken`              | Token dell'app per una connessione di gestione remota.                                                              |
| `-Credential`            | Credenziali per l'API di gestione.                                                                                  |
| `-UseDefaultCredentials` | Usi le credenziali Windows correnti per la connessione di gestione.                                                 |
| `-Integrated`            | Usi il client di gestione PSU nel processo quando il cmdlet viene eseguito all'interno di PSU.                      |
| `-TrustCertificate`      | Consente una connessione remota con un certificato TLS non attendibile.                                             |
| `-Cookies`               | Riutilizzi e mantenga i cookie di autenticazione in questa sessione di PowerShell.                                  |

## AUTORIZZAZIONI

Il token di accesso richiede `apis.eventhubs/execute` per eseguire questo cmdlet in remoto. Questo vale anche quando il comando ha come destinazione un computer o un gruppo di computer.


---

# 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/send-psuevent.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.
