From fd89089f3969e40eef83348ee533120cbac377cb Mon Sep 17 00:00:00 2001 From: John Duprey Date: Tue, 7 Jan 2025 11:55:10 -0500 Subject: [PATCH] fix large backups --- .../HTTP Functions/CIPP/Core/Invoke-ExecListBackup.ps1 | 1 + Modules/CIPPCore/Public/Get-CIPPAzDatatableEntity.ps1 | 1 + Modules/CIPPCore/Public/Get-CIPPBackup.ps1 | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/CIPP/Core/Invoke-ExecListBackup.ps1 b/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/CIPP/Core/Invoke-ExecListBackup.ps1 index ded6b8feaded..268f91caac18 100644 --- a/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/CIPP/Core/Invoke-ExecListBackup.ps1 +++ b/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/CIPP/Core/Invoke-ExecListBackup.ps1 @@ -25,6 +25,7 @@ Function Invoke-ExecListBackup { } $Result = Get-CIPPBackup @CippBackupParams + Write-Host ($Result | ConvertTo-Json) if ($request.Query.NameOnly) { $Result = $Result | Select-Object @{Name = 'BackupName'; exp = { $_.RowKey } }, Timestamp | Sort-Object Timestamp -Descending } diff --git a/Modules/CIPPCore/Public/Get-CIPPAzDatatableEntity.ps1 b/Modules/CIPPCore/Public/Get-CIPPAzDatatableEntity.ps1 index fd5676683860..f7f6362b8e22 100644 --- a/Modules/CIPPCore/Public/Get-CIPPAzDatatableEntity.ps1 +++ b/Modules/CIPPCore/Public/Get-CIPPAzDatatableEntity.ps1 @@ -59,6 +59,7 @@ function Get-CIPPAzDataTableEntity { } $fullEntity | Add-Member -MemberType NoteProperty -Name 'PartitionKey' -Value $parts[0].PartitionKey -Force $fullEntity | Add-Member -MemberType NoteProperty -Name 'RowKey' -Value $entityId -Force + $fullEntity | Add-Member -MemberType NoteProperty -Name 'Timestamp' -Value $parts[0].Timestamp -Force $finalResults = $finalResults + @($fullEntity) } else { $finalResults = $finalResults + @($entityData.Entity) diff --git a/Modules/CIPPCore/Public/Get-CIPPBackup.ps1 b/Modules/CIPPCore/Public/Get-CIPPBackup.ps1 index dab2f5b63a26..91d29ac8ec0f 100644 --- a/Modules/CIPPCore/Public/Get-CIPPBackup.ps1 +++ b/Modules/CIPPCore/Public/Get-CIPPBackup.ps1 @@ -16,11 +16,11 @@ function Get-CIPPBackup { $Conditions.Add("TenantFilter eq '$($TenantFilter)'") } if ($Name) { - $Conditions.Add("RowKey eq '$($Name)'") + $Conditions.Add("RowKey eq '$($Name)' or OriginalEntityId eq '$($Name)'") } if ($NameOnly.IsPresent) { - $Table.Property = @('PartitionKey', 'RowKey', 'Timestamp') + $Table.Property = @('PartitionKey', 'RowKey', 'Timestamp', 'OriginalEntityId') } $Filter = $Conditions -join ' and '