From 8fa5f37c4461c4d662f792cc8a19b1e5752f58ec Mon Sep 17 00:00:00 2001 From: KelvinTegelaar <49186168+KelvinTegelaar@users.noreply.github.com> Date: Mon, 3 Feb 2025 14:40:23 +0100 Subject: [PATCH] single run template failure --- .../Tenant/Standards/Invoke-ExecStandardsRun.ps1 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tenant/Standards/Invoke-ExecStandardsRun.ps1 b/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tenant/Standards/Invoke-ExecStandardsRun.ps1 index 74c88643ce89..e48a6cca61e5 100644 --- a/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tenant/Standards/Invoke-ExecStandardsRun.ps1 +++ b/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tenant/Standards/Invoke-ExecStandardsRun.ps1 @@ -15,7 +15,13 @@ Function Invoke-ExecStandardsRun { $TemplateId = if ($Request.Query.TemplateId) { $Request.Query.TemplateId } else { '*' } $Table = Get-CippTable -tablename 'templates' $Filter = "PartitionKey eq 'StandardsTemplateV2'" - $Templates = (Get-CIPPAzDataTableEntity @Table -Filter $Filter | Sort-Object TimeStamp).JSON | ConvertFrom-Json | Where-Object { + $Templates = (Get-CIPPAzDataTableEntity @Table -Filter $Filter | Sort-Object TimeStamp).JSON | ForEach-Object { + try { + ConvertFrom-Json $_ -ErrorAction SilentlyContinue + } catch { + + } + } | Where-Object { $_.guid -like $TemplateId }