Skip to content

Commit dbc08cc

Browse files
authored
Merge pull request #655 from KelvinTegelaar/dev
[pull] dev from KelvinTegelaar:dev
2 parents 8271f4c + 9846930 commit dbc08cc

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

Modules/CIPPCore/Public/Add-CIPPDbItem.ps1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ function Add-CIPPDbItem {
4242

4343
try {
4444
$Table = Get-CippTable -tablename 'CippReportingDB'
45+
#Get the existing type entries and nuke them. This ensures we don't have stale data.
46+
$Filter = "PartitionKey eq '{0}' and RowKey ge '{1}-' and RowKey lt '{1}0'" -f $TenantFilter, $Type
47+
$ExistingEntities = Get-CIPPAzDataTableEntity @Table -Filter $Filter
48+
if ($ExistingEntities) {
49+
Remove-AzDataTableEntity @Table -Entity $ExistingEntities -Force | Out-Null
50+
}
4551

4652
if ($Count) {
4753
$Entity = @{
@@ -54,7 +60,7 @@ function Add-CIPPDbItem {
5460

5561
} else {
5662
$Entities = foreach ($Item in $Data) {
57-
$ItemId = $Item.id
63+
$ItemId = $Item.id ? $Item.id : $item.skuId
5864
@{
5965
PartitionKey = $TenantFilter
6066
RowKey = "$Type-$ItemId"

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Invoke-ListAvailableTests.ps1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ function Invoke-ListAvailableTests {
7373
$StatusCode = [HttpStatusCode]::OK
7474
} catch {
7575
$ErrorMessage = Get-CippException -Exception $_
76-
Write-LogMessage -user $Request.Headers.'x-ms-client-principal' -API $APIName -message "Failed to list available tests: $($ErrorMessage.NormalizedError)" -Sev 'Error' -LogData $ErrorMessage
7776
$Body = [PSCustomObject]@{
7877
Results = "Failed to list available tests: $($ErrorMessage.NormalizedError)"
7978
}

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Invoke-ListTests.ps1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,11 @@ function Invoke-ListTests {
121121
$TestResultsData | Add-Member -NotePropertyName 'MFAState' -NotePropertyValue $MFAStateData -Force
122122
}
123123

124+
$LicenseData = New-CIPPDbRequest -TenantFilter $TenantFilter -Type 'LicenseOverview'
125+
if ($LicenseData) {
126+
$TestResultsData | Add-Member -NotePropertyName 'LicenseData' -NotePropertyValue @($LicenseData) -Force
127+
}
128+
124129
$StatusCode = [HttpStatusCode]::OK
125130
$Body = $TestResultsData
126131

Modules/CIPPCore/Public/Get-CIPPDbItem.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,4 @@ function Get-CIPPDbItem {
5555
throw
5656
}
5757
}
58+

0 commit comments

Comments
 (0)