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

# Statiske apps

Publicer statiske PowerShell Universal-apps med Publish-PSUStaticApp for at hoste dashboards på en hvilken som helst webserver uden en PSU-backend, med forståelse af de vigtigste begrænsninger.

Statiske PowerShell Universal-apps kræver ikke, at PowerShell Universal-serveren kører. Appsene kan hostes på enkle webservere som Azure Blobs eller i IIS direkte fra filsystemet. Appsene består af JavaScript-frameworket PowerShell Universal App og en række JSON-filer, der oprettes under publiceringsprocessen. Statiske apps understøtter ikke de interaktive funktioner i PowerShell Universal. Kørsel af JavaScript understøttes dog.

## Opbygning af en statisk app

Cmdletten `Publish-PSUStaticApp` står for at bygge en app. De kan bruge standard-App-cmdletter i definitionen. Nedenstående ville for eksempel oprette en app i outputmappen med en enkelt UDRating-komponent.

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

De kan også indsætte et JavaScript-kald i Deres app overalt, hvor et slutpunkt kan bruges. F.eks. i parameteren `-OnChange` for `New-UDRating`. Variablen data indeholder dataene fra hændelsen.

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

## Publicering af en statisk app

Statiske apps kan publiceres til enhver webserver, der kan udlevere HTML-, JavaScript- og CSS-filer. De skal publicere hele indholdet af outputmappen, for at appen kan fungere.

## Begrænsninger

### Ingen appinteraktion

De kan ikke bruge interaktive funktioner i PowerShell Universal Apps bortset fra JavaScript. Dette omfatter, men er ikke begrænset til:

* Modaler og toasts
* -UDElement Cmdlets
* Dataudbydere som $Cache og $Session

### Ingen interaktion med PowerShell-værten

Under opbygningen af appen køres alle scriptblokke i appen i stedet for at køre efter behov, som når den er hostet i PowerShell Universal. Det betyder, at kommandoer som `Write-Host` og `Write-Error` sker under opbygningen og ikke, når appen kører i browseren. Følgende køres også med det samme:

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

### Begrænset support til kontrolelementer

Selvom det er muligt at bruge et hvilket som helst kontrolelement og angive JavaScript til dets interaktion, anbefales det ikke på grund af kompleksiteten. Kontrolelementer, der bør undgås, omfatter:

* Datagitter
* Dynamisk region
* Beskyt sektion


---

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