Skip to content

Commit

Permalink
standards fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
KelvinTegelaar committed Jan 17, 2025
1 parent 8e52bcd commit a561840
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@ Function Invoke-listStandardTemplates {
$Table = Get-CippTable -tablename 'templates'
$Filter = "PartitionKey eq 'StandardsTemplateV2'"
$Templates = (Get-CIPPAzDataTableEntity @Table -Filter $Filter) | ForEach-Object {
$data = $_.JSON | ConvertFrom-Json -Depth 100 -ErrorAction SilentlyContinue
$JSON = $_.JSON
try {
$data = $_.JSON | ConvertFrom-Json -Depth 100 -ErrorAction SilentlyContinue
} catch {
Write-Host "Could not load standard template: $($_.Exception.Message). Content of the template is: $($JSON)"
return
}
$data | Add-Member -NotePropertyName 'GUID' -NotePropertyValue $_.GUID -Force
if ($data.excludedTenants) { $data.excludedTenants = @($data.excludedTenants) }
$data
Expand Down

0 comments on commit a561840

Please sign in to comment.