File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
Entrypoints/HTTP Functions/Teams-Sharepoint Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,10 @@ Function Invoke-ListSharepointQuota {
2222 } else {
2323 try {
2424 $SharePointInfo = Get-SharePointAdminLink - Public $false - tenantFilter $TenantFilter
25- $SharePointQuota = (New-GraphGetRequest - scope " $ ( $SharePointInfo.AdminUrl ) /.default" - tenantid $TenantFilter - uri " $ ( $SharePointInfo.AdminUrl ) /_api/StorageQuotas()?api-version=1.3.2" ).value | Sort-Object - Property GeoUsedStorageMB - Descending | Select-Object - First 1
25+ $extraHeaders = @ {
26+ ' Accept' = ' application/json'
27+ }
28+ $SharePointQuota = (New-GraphGetRequest - extraHeaders $extraHeaders - scope " $ ( $SharePointInfo.AdminUrl ) /.default" - tenantid $TenantFilter - uri " $ ( $SharePointInfo.AdminUrl ) /_api/StorageQuotas()?api-version=1.3.2" ) | Sort-Object - Property GeoUsedStorageMB - Descending | Select-Object - First 1
2629
2730 if ($SharePointQuota ) {
2831 $UsedStoragePercentage = [int ](($SharePointQuota.GeoUsedStorageMB / $SharePointQuota.TenantStorageMB ) * 100 )
Original file line number Diff line number Diff line change @@ -15,7 +15,8 @@ function New-GraphGetRequest {
1515 $Caller ,
1616 [switch ]$ComplexFilter ,
1717 [switch ]$CountOnly ,
18- [switch ]$IncludeResponseHeaders
18+ [switch ]$IncludeResponseHeaders ,
19+ [hashtable ]$extraHeaders
1920 )
2021
2122 if ($NoAuthCheck -eq $false ) {
@@ -35,7 +36,11 @@ function New-GraphGetRequest {
3536 $headers [' ConsistencyLevel' ] = ' eventual'
3637 }
3738 $nextURL = $uri
38-
39+ if ($extraHeaders ) {
40+ foreach ($key in $extraHeaders.Keys ) {
41+ $headers [$key ] = $extraHeaders [$key ]
42+ }
43+ }
3944 # Track consecutive Graph API failures
4045 $TenantsTable = Get-CippTable - tablename Tenants
4146 $Filter = " PartitionKey eq 'Tenants' and (defaultDomainName eq '{0}' or customerId eq '{0}')" -f $tenantid
You can’t perform that action at this time.
0 commit comments