> 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/new-psuworkflowactivity.md).

# New-PSUWorkflowActivity

New-PSUWorkflowActivity crea una definizione di attività del flusso di lavoro in PowerShell Universal che può essere incorporata in un blocco di script di definizione del flusso di lavoro.

## SINOSSI

Crea una definizione di attività del flusso di lavoro.

## SINTASSI

```powershell
New-PSUWorkflowActivity -Type <String> [-Id <String>] [-Name <String>] [-ScriptFullPath <String>] [-TrueContinueAfterDecision <Boolean>] [-FalseContinueAfterDecision <Boolean>] [-Parameters <Hashtable>] [-Expressions <Hashtable>] [<ConnectionOptions>] [<CommonParameters>]
```

`<ConnectionOptions>`: `[-ComputerName <String>] [-AppToken <String>] [-Credential <PSCredential>] [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies]`. I metadati dell'attività possono esporre parametri dinamici aggiuntivi per il `-Type` scelto.

## DESCRIZIONE

Compila un'attività per il blocco di script `-Definition` di `New-PSUWorkflow`. `-Parameters` fornisce le proprietà letterali dell'attività e `-Expressions` fornisce espressioni di PowerShell valutate in fase di esecuzione. Le attività contenitore, incluse `Sequence` e `Parallel`, supportano attività annidate. Il cmdlet cerca i metadati dell'attività per convalidare il tipo ed esporre parametri dinamici; se la ricerca dei parametri dinamici non riesce, usi `-Parameters`.

## ESEMPIO

```powershell
New-PSUWorkflowActivity -Type Parallel -Activities {
    New-PSUWorkflowActivity -Type Script -ScriptFullPath 'C:\Repository\Test1.ps1'
    New-PSUWorkflowActivity -Type Script -ScriptFullPath 'C:\Repository\Test2.ps1'
}
```

## PARAMETRI

| Parametro                     | Descrizione                                                                                 |
| ----------------------------- | ------------------------------------------------------------------------------------------- |
| `-Type`                       | Tipo di attività del flusso di lavoro registrata, obbligatorio.                             |
| `-Id`                         | Identificatore dell'attività.                                                               |
| `-Name`                       | Nome dell'attività.                                                                         |
| `-ScriptFullPath`             | Percorso dello script di un'attività supportata da uno script.                              |
| `-TrueContinueAfterDecision`  | Indica se il ramo vero continua dopo una decisione (`$true` per impostazione predefinita).  |
| `-FalseContinueAfterDecision` | Indica se il ramo falso continua dopo una decisione (`$true` per impostazione predefinita). |
| `-Parameters`                 | Hashtable dei valori letterali delle proprietà dell'attività.                               |
| `-Expressions`                | Hashtable delle espressioni di PowerShell in fase di esecuzione.                            |
| `-ComputerName`               | URL o nome host del server PSU per la ricerca dei metadati (alias `-Uri`).                  |
| `-AppToken`                   | Token dell'app dell'API di gestione per la ricerca dei metadati.                            |
| `-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.                                       |

## AUTORIZZAZIONI

Il token di accesso richiede `automation.workflows/read` per eseguire questo cmdlet in remoto. Il cmdlet legge i metadati dell'attività per compilare una definizione di flusso di lavoro; non crea un flusso di lavoro sul server.


---

# 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/new-psuworkflowactivity.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.
