> 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/de/powershell-befehle/set-psucache.md).

# Set-PSUCache

## ÜBERSICHT

Legt ein Objekt im serverseitigen Cache von PowerShell Universal ab.

## SYNTAX

### None (Standard)

```
Set-PSUCache -Key <String> -Value <Object> [-Persist] [-Role <String[]>] [-Depth <Int32>]
 [-ComputerName <String>] [-AppToken <String>] [-Credential <PSCredential>] [-UseDefaultCredentials]
 [-Integrated] [-TrustCertificate] [-Cookies] [<CommonParameters>]
```

### Absolute

```
Set-PSUCache -Key <String> -Value <Object> [-AbsoluteExpiration <DateTime>] [-Persist] [-Role <String[]>]
 [-Depth <Int32>] [-ComputerName <String>] [-AppToken <String>] [-Credential <PSCredential>]
 [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies]
 [<CommonParameters>]
```

### AbsoluteExpirationFromNow

```
Set-PSUCache -Key <String> -Value <Object> [-AbsoluteExpirationFromNow <TimeSpan>] [-Persist]
 [-Role <String[]>] [-Depth <Int32>] [-ComputerName <String>] [-AppToken <String>] [-Credential <PSCredential>]
 [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies]
 [<CommonParameters>]
```

### SlidingExpiration

```
Set-PSUCache -Key <String> -Value <Object> [-SlidingExpiration <TimeSpan>] [-Persist] [-Role <String[]>]
 [-Depth <Int32>] [-ComputerName <String>] [-AppToken <String>] [-Credential <PSCredential>]
 [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies]
 [<CommonParameters>]
```

## BESCHREIBUNG

Legt ein Objekt im serverseitigen Cache von PowerShell Universal ab. Dieses Cmdlet ist innerhalb von APIs, Dashboards und Skripten zu verwenden. Sie können Cache-Daten nicht über die Management-API abrufen.

## BEISPIELE

### Beispiel 1

```powershell
PS C:\> Set-PSUCache -Key 'Data' -Value 'MyValue'
```

Speichert Daten dauerhaft im Cache auf Serverebene.

### Beispiel 2

```powershell
PS C:\> Set-PSUCache -Key 'Data' -Value 'MyValue' -AbsoluteExpiration (Get-Date).AddMinutes(10)
```

Speichert Daten im Cache, die in 10 Minuten ablaufen.

### Beispiel 3

```powershell
PS C:\> Set-PSUCache -Key 'Data' -Value 'MyValue' -AbsoluteExpirationFromNow [TimeSpan]::FromMinutes(30)
```

Speichert Daten im Cache, die in 30 Minuten ablaufen.

### Beispiel 4

```powershell
PS C:\> Set-PSUCache -Key 'Data' -Value 'MyValue' -SlidingExpiration [TimeSpan]::FromMinutes(10)
```

Speichert Daten mit einem gleitenden Cache von 10 Minuten. Wenn die Daten 10 Minuten lang nicht abgerufen werden, werden sie ungültig und aus dem Cache entfernt. Wenn die Daten abgerufen werden, wird der Timer für weitere 10 Minuten zurückgesetzt.

## PARAMETER

### -AbsoluteExpiration

Eine absolute Ablaufzeit für die Daten im Cache.

```yaml
Type: DateTime
Parameter Sets: Absolute
Aliases:

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

### -AbsoluteExpirationFromNow

Ein TimeSpan, der angibt, wie lange von jetzt an die Daten aus dem Cache entfernt werden sollen.

```yaml
Type: TimeSpan
Parameter Sets: AbsoluteExpirationFromNow
Aliases:

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

### -Key

Ein Schlüssel zum Nachschlagen der Daten im Cache.

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

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

### -SlidingExpiration

Ein TimeSpan, der den gleitenden Ablauf für Daten im Cache angibt.

```yaml
Type: TimeSpan
Parameter Sets: SlidingExpiration
Aliases:

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

### -Value

Das im Cache zu speichernde Objekt. Dieses Objekt wird in CLIXML serialisiert.

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

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

### -AppToken

Gibt das App-Token an, das bei der Authentifizierung gegenüber der Management-API von PowerShell Universal verwendet wird.

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

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

### -ComputerName

Gibt die URL oder den Hostnamen der Ziel-Instanz von PowerShell Universal an. Reine Hostnamen werden zu einer http\://:5000-URL normalisiert.

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

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

### -Integrated

Führt den Befehl intern aus, anstatt die Management-API zu verwenden. Funktioniert nur, wenn das Skript innerhalb von PowerShell Universal ausgeführt wird.

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

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

### -UseDefaultCredentials

Stellt Windows-Anmeldeinformationen bei der Authentifizierung gegenüber PowerShell Universal bereit.

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

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

### -Credential

Anmeldeinformationen für die Anmeldung bei der Management-API von PowerShell Universal.

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

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

### -Persist

Speichert Cache-Daten dauerhaft in der Datenbank.

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

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

### -Role

Die Rollen, die Zugriff auf diese zwischengespeicherten Daten haben.

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

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

### -TrustCertificate

Gibt an, ob das Cmdlet Zertifikatsprobleme ignorieren soll.

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

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

### -Cookies

Verwendet und speichert Authentifizierungs-Cookies für die aktuelle PowerShell-Sitzung erneut.

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

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

### -Depth

Gibt die Serialisierungstiefe an, die beim Konvertieren von Werten vor dem Senden an den Server verwendet wird.

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

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

### CommonParameters

Dieses Cmdlet unterstützt die allgemeinen Parameter: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -Verbose, -WarningAction, -WarningVariable und -ProgressAction. Weitere Informationen finden Sie unter [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).

## EINGABEN

### Keine

## AUSGABEN

### System.Object

## HINWEISE

## VERWANDTE LINKS

[Get-PSUCache](/powershell-universal/de/powershell-befehle/get-psucache.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 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/de/powershell-befehle/set-psucache.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.
