> 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/app/static-apps.md).

# App statiche

Le app statiche di PowerShell Universal non richiedono l'esecuzione del server PowerShell Universal. Possono essere ospitate su semplici server web come Azure Blobs o in IIS direttamente dal file system. Sono costituite dal framework JavaScript delle app di PowerShell Universal e da una serie di file JSON creati durante il processo di pubblicazione. Le app statiche non supportano le funzionalità interattive di PowerShell Universal. Supportano invece l'esecuzione di JavaScript.

## Creazione di un'app statica

Il cmdlet `Publish-PSUStaticApp` si occupa della creazione di un'app. Nella definizione può utilizzare i cmdlet standard delle app. Ad esempio, il seguente creerebbe un'app nella cartella di output con un singolo componente UDRating.

```powershell
Publish-PSUStaticApp -Definition { 
    New-UDApp -Content { 
       New-UDRating -Max 10 
    } 
} -DestinationPath .\output -Force 
```

Può anche introdurre chiamate JavaScript nella sua app ovunque sia possibile utilizzare un endpoint. Ad esempio, nel parametro `-OnChange` di `New-UDRating`. La variabile data conterrà i dati dell'evento.

```powershell
Publish-PSUStaticApp -Definition {
   New-UDApp -Content {
      New-UDRating -Max 10 -OnChange (New-UDEndpoint -JavaScript 'alert(data)') 
   } 
} -DestinationPath .\output -Force 
```

## Pubblicazione di un'app statica

Le app statiche possono essere pubblicate su qualsiasi server web in grado di servire file HTML, JavaScript e CSS. Dovrà pubblicare l'intero contenuto della cartella di output affinché l'app funzioni.

## Limitazioni

### Nessuna interazione con l'app

Non è possibile utilizzare le funzionalità interattive delle app di PowerShell Universal, ad eccezione di JavaScript. Questo include, a titolo esemplificativo:

* Modali e toast
* Cmdlet -UDElement
* Provider di dati come $Cache e $Session

### Nessuna interazione con l'host PowerShell

Durante la creazione dell'app, tutti gli script block contenuti nell'app verranno eseguiti, anziché essere eseguiti su richiesta, come avviene quando sono ospitati in PowerShell Universal. Ciò significa che comandi come `Write-Host` e `Write-Error` avverranno durante la creazione e non quando l'app è in esecuzione nel browser. Anche i seguenti verranno eseguiti immediatamente:

* `Read-Host`
* `PromptForChoice`
* `Get-Credential`

### Supporto limitato dei controlli

Sebbene sia possibile utilizzare qualsiasi controllo e specificare il JavaScript per la sua interazione, non è consigliato a causa della complessità. I controlli da evitare includono:

* Data Grid
* Dynamic Region
* Protect Section


---

# 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/app/static-apps.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.
