File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Modules/CIPPCore/Public/Functions Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -72,7 +72,15 @@ function Get-CIPPTenantAlignment {
72
72
if ($FieldValue -is [System.Boolean ]) {
73
73
$FieldValue = [bool ]$FieldValue
74
74
} elseif ($FieldValue -like ' *{*' ) {
75
- $FieldValue = ConvertFrom-Json - Depth 100 - InputObject $FieldValue - ErrorAction SilentlyContinue
75
+ try {
76
+ $FieldValue = ConvertFrom-Json - Depth 100 - InputObject $FieldValue - ErrorAction SilentlyContinue
77
+ } catch {
78
+ Write-Warning " $ ( $FieldName ) standard report could not be loaded: $ ( $_.Exception.Message ) "
79
+ $FieldValue = [PSCustomObject ]@ {
80
+ Error = " Invalid JSON format: $ ( $_.Exception.Message ) "
81
+ OriginalValue = $FieldValue
82
+ }
83
+ }
76
84
} else {
77
85
$FieldValue = [string ]$FieldValue
78
86
}
You can’t perform that action at this time.
0 commit comments