> 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/scheduled-endpoints.md).

# Planlagte slutpunkter

Planlæg lette PowerShell-scriptblokke i PowerShell Universal-apps med New-UDEndpoint for at cachelagre data som proceslister til hurtigere dashboards.

{% hint style="info" %}
Vi anbefaler, at De overvejer [Scheduled jobs](/powershell-universal/da/automatisering/schedules.md) frem for planlagte slutpunkter til jobs, der kræver sporing af output, input, historik eller komplekse planlægningsregler.
{% endhint %}

Planlagte slutpunkter giver Dem mulighed for at køre PowerShell-scriptblokke efter en tidsplan i Deres app. Planlagte slutpunkter er mere letvægtede end planlagte job, men giver ikke samme niveau af funktionalitet. Planlagte slutpunkter sporer ingen historik, outputtet logges ikke, og tidsplanerne er ikke synlige i UI'et.

Planlagte slutpunkter er nyttige, når De indlæser og cachelagrer data, som De kun vil bruge i Deres dashboard. Data, der er gemt i app-cachen, deles ikke på tværs af PowerShell Universal.

## Planlægning af et slutpunkt

Nedenstående er et eksempel på planlægning af et slutpunkt, der kører hvert 10. sekund og gemmer oplysninger i en cachevariabel. Denne type konfiguration øger appens ydeevne for slutbrugere, da cachedataene returneres i stedet for at kalde `Get-Process` ved hver indlæsning af appen.

```powershell
$EndpointSchedule = New-UDEndpointSchedule -Every 10 -Second
New-UDEndpoint -Schedule $EndpointSchedule -Endpoint {
    $Cache:Processes = Get-Process | Select-Object Name,ID
} | Out-Null

New-UDApp -Title 'Test' -Content {
    New-UDTable -Data $Cache:Processes
}
```

### Cachelagring af serverdækkende data

De kan også bruge de[ serverdækkende data ](/powershell-universal/da/platform/cache.md)cachefunktioner i Apps. Det betyder, at De vil kunne få adgang til de data i alle scripts i PowerShell Universal. I Deres app kan De indlæse cachen med det planlagte slutpunkt.

```powershell
$EndpointSchedule = New-UDEndpointSchedule -Every 10 -Second
New-UDEndpoint -Schedule $EndpointSchedule -Endpoint {
   $Processes = Get-Process | Select-Object Name,ID
   Set-PSUCache -Name 'Processes' -Value $Processes
} | Out-Null

New-UDApp -Title 'Test' -Content {

}
```

De kan derefter bruge cachedataene i Deres API.

```powershell
New-PSUEndpoint -Url '/process' -Method Get -Endpoint {
    Get-PSUCache -Name 'Processes'
}
```

## API

* [New-UDEndpoint](/powershell-universal/da/powershell-kommandoer/new-udendpoint.md)
* [New-UDEndpointSchedule](/powershell-universal/da/powershell-kommandoer/new-udendpointschedule.md)


---

# 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/scheduled-endpoints.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.
