Skip to content

Commit bcaad30

Browse files
fix template run
1 parent 71fb7c3 commit bcaad30

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

Modules/CIPPCore/Public/New-CIPPTemplateRun.ps1

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@ function New-CIPPTemplateRun {
66
)
77
$Table = Get-CippTable -tablename 'templates'
88
$ExistingTemplates = (Get-CIPPAzDataTableEntity @Table) | ForEach-Object {
9-
$data = $_.JSON | ConvertFrom-Json -ErrorAction SilentlyContinue -Depth 100
10-
$data | Add-Member -NotePropertyName 'GUID' -NotePropertyValue $_.RowKey -Force
11-
$data | Add-Member -NotePropertyName 'PartitionKey' -NotePropertyValue $_.PartitionKey -Force
12-
$data | Add-Member -NotePropertyName 'SHA' -NotePropertyValue $_.SHA -Force
13-
$data
9+
try {
10+
$data = $_.JSON | ConvertFrom-Json -ErrorAction SilentlyContinue -Depth 100
11+
$data | Add-Member -NotePropertyName 'GUID' -NotePropertyValue $_.RowKey -Force -ErrorAction Stop
12+
$data | Add-Member -NotePropertyName 'PartitionKey' -NotePropertyValue $_.PartitionKey -Force -ErrorAction Stop
13+
$data | Add-Member -NotePropertyName 'SHA' -NotePropertyValue $_.SHA -Force -ErrorAction Stop
14+
$data
15+
} catch {
16+
return
17+
}
1418
} | Sort-Object -Property displayName
1519

1620
function Get-SanitizedFilename {

0 commit comments

Comments
 (0)