> 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-psuapp.md).

# New-PSUApp

## SINOSSI

Crea una nuova app in PowerShell Universal.

## SINTASSI

### FilePath (predefinito)

```
New-PSUApp [-FilePath <String>] [-BaseUrl <String>] -Name <String> [-Environment <String>] [-GrantAppToken]
 [-Maintenance] [-Authenticated] [-Role <String[]>] [-DisableAutoStart] [-Component <DashboardComponent[]>]
 [-SessionTimeout <Int32>] [-IdleTimeout <Int32>] [-AutoDeploy] [-Description <String>] [-Credential <String>]
 [-DisableErrorToast] [-DisableStartupLog] [-VerboseErrorMessages] [-Tag <Tag[]>] [-DisableInteractiveHost]
 [-FavIcon <String>] [-OnSessionTimeout <ScriptBlock>] [-ComputerGroup <String[]>]
 [-AvailableInBranch <String[]>] [-Critical] [-ComputerName <String>] [-AppToken <String>]
 [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies]
 [<CommonParameters>]
```

### Content

```
New-PSUApp -Content <ScriptBlock> [-BaseUrl <String>] -Name <String> [-Environment <String>] [-GrantAppToken]
 [-Maintenance] [-Authenticated] [-Role <String[]>] [-DisableAutoStart] [-Component <DashboardComponent[]>]
 [-SessionTimeout <Int32>] [-IdleTimeout <Int32>] [-AutoDeploy] [-Description <String>] [-Credential <String>]
 [-DisableErrorToast] [-DisableStartupLog] [-VerboseErrorMessages] [-Tag <Tag[]>] [-DisableInteractiveHost]
 [-FavIcon <String>] [-OnSessionTimeout <ScriptBlock>] [-ComputerGroup <String[]>]
 [-AvailableInBranch <String[]>] [-Critical] [-ComputerName <String>] [-AppToken <String>]
 [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies]
 [<CommonParameters>]
```

### Module

```
New-PSUApp [-BaseUrl <String>] -Name <String> [-Environment <String>] [-GrantAppToken] [-Maintenance]
 [-Authenticated] [-Role <String[]>] [-DisableAutoStart] [-Component <DashboardComponent[]>]
 [-SessionTimeout <Int32>] [-IdleTimeout <Int32>] [-AutoDeploy] [-Description <String>] [-Credential <String>]
 [-DisableErrorToast] [-DisableStartupLog] [-VerboseErrorMessages] [-Tag <Tag[]>] [-DisableInteractiveHost]
 [-Module <String>] [-Command <String>] [-FavIcon <String>] [-OnSessionTimeout <ScriptBlock>]
 [-ComputerGroup <String[]>] [-AvailableInBranch <String[]>] [-Critical] [-ComputerName <String>]
 [-AppToken <String>] [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies]
 [<CommonParameters>]
```

## DESCRIZIONE

Crea una nuova app in PowerShell Universal.

## ESEMPI

### Esempio 1

```powershell
New-PSUApp -Name 'App' -BaseUrl '/app' -FilePath "app.ps1"
```

Crea un'app utilizzando il file app.ps1 nella directory del repository e la pubblica all'URL di base /app.

## PARAMETRI

### -AppToken

L'AppToken utilizzato per chiamare l'API di gestione di PowerShell Universal. È inoltre possibile chiamare Connect-PSUServer prima di eseguire questo cmdlet per impostare l'AppToken per l'intera sessione.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Authenticated

Se specificato, l'autenticazione è abilitata per questa app.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -AutoDeploy

Indica se distribuire questa app quando vengono apportate modifiche. Se non specificato, è necessario riavviare l'app prima che le modifiche vengano applicate.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -BaseUrl

L'URL di base per accedere a questa app. È possibile utilizzare / per pubblicare l'app nella radice del server oppure /app per pubblicare l'app in /app.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Command

Il comando utilizzato per creare questa app.

```yaml
Type: String
Parameter Sets: Module
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Component

Non utilizzato. Presente solo per compatibilità con le versioni precedenti.

```yaml
Type: DashboardComponent[]
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -ComputerName

Specifica il nome del computer o l'URL da chiamare quando si accede all'API di gestione di PowerShell Universal. È inoltre possibile utilizzare Connect-PSUServer prima di eseguire questo cmdlet per impostare il nome del computer per l'intera sessione.

```yaml
Type: String
Parameter Sets: (All)
Aliases: Uri

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Content

Il contenuto di questa app.

```yaml
Type: ScriptBlock
Parameter Sets: Content
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Credential

La credenziale utente con cui eseguire questa app.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Description

Una descrizione di questa app.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -DisableAutoStart

Indica se disabilitare l'avvio automatico di questa app all'avvio del server.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -DisableErrorToast

Indica se disabilitare i toast di errore per questa app.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -DisableInteractiveHost

Indica se disabilitare l'host interattivo per questa app. Write-Host, Read-Host, Get-Credential e altre funzionalità non funzioneranno più.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -DisableStartupLog

Indica se disabilitare il log di avvio per questa app.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Environment

L'ambiente in cui eseguire questa app.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -FavIcon

L'URL della favicon per questa app.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -FilePath

Il percorso del file che contiene il contenuto di questa app.

```yaml
Type: String
Parameter Sets: FilePath
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -GrantAppToken

Indica se concedere un token app agli utenti di questa app. È possibile utilizzare il token app all'interno dell'app per accedere alle risorse di PSU come l'utente che effettua l'accesso.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -IdleTimeout

Il timeout di inattività per questa app.

```yaml
Type: Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Integrated

Esegue il comando internamente anziché utilizzare l'API di gestione. Funziona solo quando lo script viene eseguito all'interno di PowerShell Universal.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Maintenance

Indica se mettere questa app in modalità di manutenzione. Solo gli amministratori potranno accedere all'app quando è in modalità di manutenzione.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Module

Il modulo che contiene il comando utilizzato per definire questa app.

```yaml
Type: String
Parameter Sets: Module
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Name

Il nome di questa app.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Role

Ruoli che hanno accesso a questa app.

```yaml
Type: String[]
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -SessionTimeout

Il timeout della sessione per questa app.

```yaml
Type: Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Tag

Tag da applicare a questa app.

```yaml
Type: Tag[]
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -UseDefaultCredentials

Utilizza le credenziali predefinite durante la connessione all'API di gestione

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -VerboseErrorMessages

Indica se visualizzare messaggi di errore dettagliati per questa app.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -ComputerGroup

Specifica il gruppo di computer da destinare o assegnare.

```yaml
Type: String[]
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -OnSessionTimeout

Specifica il blocco di script da eseguire quando una sessione dell'app scade.

```yaml
Type: ScriptBlock
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -AvailableInBranch

Se specificato, questa app verrà visualizzata ed eseguita solo nei branch specificati.

```yaml
Type: String[]
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -TrustCertificate

Indica se il cmdlet deve ignorare i problemi relativi ai certificati.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Critical

L'app è critica. Ciò farà sì che l'endpoint /api/v1/status restituisca 500 se l'app non è stata avviata.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Cookies

Riutilizza e mantiene i cookie di autenticazione per la sessione PowerShell corrente.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### CommonParameters

Questo cmdlet supporta i parametri comuni: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -Verbose, -WarningAction, -WarningVariable e -ProgressAction. Per ulteriori informazioni, vedere [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).

## INPUT

### Nessuno

## OUTPUT

### System.Object

## NOTE

## LINK CORRELATI


---

# 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-universal/it/comandi-powershell/new-psuapp.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.
