Set-PSUCachecmdlet in any PowerShell script you run in PowerShell Universal. You can also retrieve items from the cache using
Set-PSUCache. Items in the cache are serialized to strings using CLIXML and the PowerShell serializer. When you retrieve objects from the cache, they will no longer be live objects.
AbsoluteExpirationparameter defines at what time the item in the cache is invalidated.
AbsoluteExpirationFromNowparameter defines when a cache item is invalidated using a TimeSpan rather than a calculated DateTime.
SlidingExpirationparameter allows you to defines the amount of time before the cache item is invalidated. Each time the cache item is accessed, the timer is reset.
Get-PSUCachecmdlet to retrieve items from the cache. You simply need to supply the key of the item you wish to retrieve. The deserialized object will be returned from the cmdlet.