Skip to content

Commit 19b963a

Browse files
authored
Merge pull request #665 from KelvinTegelaar/dev
[pull] dev from KelvinTegelaar:dev
2 parents d64fb33 + bfe9a6f commit 19b963a

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/CIPP/Settings/Invoke-ExecTenantGroup.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function Invoke-ExecTenantGroup {
4545
}
4646
$GroupEntity | Add-Member -NotePropertyName 'GroupType' -NotePropertyValue $groupType -Force
4747
if ($groupType -eq 'dynamic' -and $dynamicRules) {
48-
$GroupEntity.DynamicRules = "$($dynamicRules | ConvertTo-Json -Depth 100 -Compress)"
48+
$GroupEntity | Add-Member -NotePropertyName 'DynamicRules' -NotePropertyValue "$($dynamicRules | ConvertTo-Json -Depth 100 -Compress)" -Force
4949
$GroupEntity | Add-Member -NotePropertyName 'RuleLogic' -NotePropertyValue $ruleLogic -Force
5050
} else {
5151
$GroupEntity | Add-Member -NotePropertyName 'RuleLogic' -NotePropertyValue $null -Force

Modules/CIPPCore/Public/Entrypoints/Invoke-ListLogs.ps1

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,8 @@ function Invoke-ListLogs {
9292
$EndDate = $Request.Query.EndDate ?? $Request.Query.DateFilter
9393

9494
if ($StartDate -and $EndDate) {
95-
# Collect logs for each partition key date in range
96-
$PartitionKeys = for ($Date = [datetime]::ParseExact($StartDate, 'yyyyMMdd', $null); $Date -le [datetime]::ParseExact($EndDate, 'yyyyMMdd', $null); $Date = $Date.AddDays(1)) {
97-
$PartitionKey = $Date.ToString('yyyyMMdd')
98-
"PartitionKey eq '$PartitionKey'"
99-
}
100-
$Filter = $PartitionKeys -join ' or '
95+
# Collect logs for date range
96+
$Filter = "PartitionKey ge '$StartDate' and PartitionKey le '$EndDate'"
10197
} elseif ($StartDate) {
10298
$Filter = "PartitionKey eq '{0}'" -f $StartDate
10399
} else {

Modules/CIPPCore/Public/Functions/Get-CIPPTenantAlignment.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ function Get-CIPPTenantAlignment {
8686
}
8787
}
8888

89-
if (-not $tenantData.ContainsKey($Tenant)) {
89+
if ($Tenant -and -not $tenantData.ContainsKey($Tenant)) {
9090
$tenantData[$Tenant] = @{}
9191
}
9292
$tenantData[$Tenant][$FieldName] = @{
@@ -245,7 +245,8 @@ function Get-CIPPTenantAlignment {
245245
# Use HashSet for Contains
246246
$IsReportingDisabled = $ReportingDisabledSet.Contains($StandardKey)
247247
# Use cached tenant data
248-
$HasStandard = $CurrentTenantStandards.ContainsKey($StandardKey)
248+
249+
$HasStandard = $StandardKey -and $CurrentTenantStandards.ContainsKey($StandardKey)
249250

250251
if ($HasStandard) {
251252
$StandardObject = $CurrentTenantStandards[$StandardKey]

0 commit comments

Comments
 (0)