From ff27ec9a94fc98de9d640f153fecc7e91a6d7604 Mon Sep 17 00:00:00 2001 From: KelvinTegelaar <49186168+KelvinTegelaar@users.noreply.github.com> Date: Tue, 21 Jan 2025 12:22:22 +0100 Subject: [PATCH] add json compress --- .../Tenant/Standards/Invoke-ExecStandardConvert.ps1 | 2 +- .../Tenant/Standards/Invoke-listStandardTemplates.ps1 | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tenant/Standards/Invoke-ExecStandardConvert.ps1 b/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tenant/Standards/Invoke-ExecStandardConvert.ps1 index 659ca385d93b..915ba2ef475b 100644 --- a/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tenant/Standards/Invoke-ExecStandardConvert.ps1 +++ b/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tenant/Standards/Invoke-ExecStandardConvert.ps1 @@ -204,7 +204,7 @@ function Invoke-ExecStandardConvert { $Converted | Add-Member -NotePropertyName 'createdAt' -NotePropertyValue ((Get-Date).ToUniversalTime()) -Force $Converted | Add-Member -NotePropertyName 'updatedBy' -NotePropertyValue 'System' -Force $Converted | Add-Member -NotePropertyName 'updatedAt' -NotePropertyValue (Get-Date).ToUniversalTime() -Force - $JSON = ConvertTo-Json -Depth 40 -InputObject $Converted + $JSON = ConvertTo-Json -Depth 100 -InputObject $Converted -Compress $Table = Get-CippTable -tablename 'templates' $Table.Force = $true diff --git a/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tenant/Standards/Invoke-listStandardTemplates.ps1 b/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tenant/Standards/Invoke-listStandardTemplates.ps1 index d7856daff6cf..ebf7a663e342 100644 --- a/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tenant/Standards/Invoke-listStandardTemplates.ps1 +++ b/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tenant/Standards/Invoke-listStandardTemplates.ps1 @@ -18,8 +18,7 @@ Function Invoke-listStandardTemplates { $RowKey = $_.RowKey $data = $_.JSON | ConvertFrom-Json -Depth 100 -ErrorAction SilentlyContinue } catch { - Write-Host "Could not load standard template: $($_.Exception.Message)." - Write-Host "Template GUID: $($RowKey)" + Write-Host "$($RowKey)" return } $data | Add-Member -NotePropertyName 'GUID' -NotePropertyValue $_.GUID -Force