File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,8 @@ function Get-CIPPSPOTenant {
33 param (
44 [Parameter (Mandatory = $true )]
55 [string ]$TenantFilter ,
6- [string ]$SharepointPrefix
6+ [string ]$SharepointPrefix ,
7+ [switch ]$SkipCache
78 )
89
910 if (! $SharepointPrefix ) {
@@ -18,11 +19,12 @@ function Get-CIPPSPOTenant {
1819
1920 $Table = Get-CIPPTable - tablename ' cachespotenant'
2021 $Filter = " PartitionKey eq 'Tenant' and RowKey eq '$TenantFilter ' and Timestamp gt datetime'$ ( (Get-Date ).AddHours(-1 ).ToString(' yyyy-MM-ddTHH:mm:ssZ' ) ) '"
21- $CachedTenant = Get-CIPPAzDataTableEntity @Table - Filter $Filter
22-
23- if ($CachedTenant -and (Test-Json $CachedTenant.JSON )) {
24- $Results = $CachedTenant.JSON | ConvertFrom-Json
25- return $Results
22+ if (! $SkipCache.IsPresent ) {
23+ $CachedTenant = Get-CIPPAzDataTableEntity @Table - Filter $Filter
24+ if ($CachedTenant -and (Test-Json $CachedTenant.JSON )) {
25+ $Results = $CachedTenant.JSON | ConvertFrom-Json
26+ return $Results
27+ }
2628 }
2729
2830 # Query tenant settings
You can’t perform that action at this time.
0 commit comments