For the complete documentation index, see llms.txt. This page is also available as Markdown.

Set-PSUCache

Sets an object into the PowerShell Universal server-side cache.

SYNOPSIS

Sets an object into the PowerShell Universal server-side cache.

SYNTAX

None (Default)

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

DESCRIPTION

Sets an object into the PowerShell Universal server-side cache. This cmdlet is to be used within APIs, Dashboards and Scripts. You cannot retrieve cache data from the Management API.

EXAMPLES

Example 1

Caches data forever within the server-level cache.

Example 2

Caches data within the cache that will expire in 10 minutes.

Example 3

Caches data within the cache that will expire in 30 minutes.

Example 4

Caches data with a sliding cache of 10 minutes. If the data isn't accessed for 10 minutes, it will be invalidated and purged from the cache. If the data is accessed, the timer will reset for another 10 minutes.

PARAMETERS

-AbsoluteExpiration

An absolute expiration time for the data in the cache.

-AbsoluteExpirationFromNow

A TimeSpan indicating how long from now the data should be removed from the cache.

-Key

A key for looking up the data in the cache.

-SlidingExpiration

A TimeSpan indicating the sliding expiration for data in the cache.

-Value

The object to store in the cache. This object will be serialized to CLIXML.

-AppToken

Specifies the app token to use when authenticating to the PowerShell Universal management API.

-ComputerName

Specifies the URL or host name of the target PowerShell Universal instance. Bare host names are normalized to an http://:5000 URL.

-Integrated

Executes the command internally rather than using the Management API. Only works when running script from within PowerShell Universal.

-UseDefaultCredentials

Provides Windows Credentials when authenticating against PowerShell Universal.

-Credential

Credentials to login to the PowerShell Universal Management API.

-Persist

Persists cache data to the database.

-Role

The roles that have access to this cached data.

-TrustCertificate

Whether the cmdlet should ignore certificate issues.

-Cookies

Reuses and persists authentication cookies for the current PowerShell session.

-Depth

Specifies the serialization depth to use when converting values before sending them to the server.

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -Verbose, -WarningAction, -WarningVariable, and -ProgressAction. For more information, see about_CommonParameters.

INPUTS

None

OUTPUTS

System.Object

NOTES

Get-PSUCache

Last updated

Was this helpful?