public override void ExecuteCmdlet() { if (string.IsNullOrEmpty(ExpiryPolicy)) { ExpiryPolicy = _DefaultExpiryPolicy; } if (ExpiryTime == null) { ExpiryTime = _DefaultExpiryTime; } string cacheServiceName = CacheClient.NormalizeCacheServiceName(Name); CacheClient.ProgressRecorder = (p) => { WriteVerbose(p); }; WriteObject(new PSCacheServiceWithNamedCaches(CacheClient.AddNamedCache(cacheServiceName, NamedCache, ExpiryPolicy, (int)ExpiryTime, WithoutEviction.IsPresent, WithNotifications.IsPresent, WithHighAvailability.IsPresent))); }
public override void ExecuteCmdlet() { WriteWarning("Managed Cache will be retired on 11/30/2016. Please migrate to Azure Redis Cache. For more information, see http://go.microsoft.com/fwlink/?LinkID=717458"); if (string.IsNullOrEmpty(ExpiryPolicy)) { ExpiryPolicy = _DefaultExpiryPolicy; } if (ExpiryTime == null) { ExpiryTime = _DefaultExpiryTime; } string cacheServiceName = CacheClient.NormalizeCacheServiceName(Name); CacheClient.ProgressRecorder = (p) => { WriteVerbose(p); }; WriteObject(new PSCacheServiceWithNamedCaches(CacheClient.AddNamedCache(cacheServiceName, NamedCache, ExpiryPolicy, (int)ExpiryTime, WithoutEviction.IsPresent, WithNotifications.IsPresent, WithHighAvailability.IsPresent))); }