File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Modules/CIPPCore/Public/Functions Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ function Get-CIPPTenantAlignment {
3434 $JSON = $_.JSON -replace ' "Action":' , ' "action":'
3535 try {
3636 $RowKey = $_.RowKey
37- $Data = $JSON | ConvertFrom-Json - Depth 100 - ErrorAction SilentlyContinue
37+ $Data = $JSON | ConvertFrom-Json - Depth 100 - ErrorAction Stop
3838 } catch {
3939 Write-Warning " $ ( $RowKey ) standard could not be loaded: $ ( $_.Exception.Message ) "
4040 return
@@ -71,9 +71,9 @@ function Get-CIPPTenantAlignment {
7171 # Process field value
7272 if ($FieldValue -is [System.Boolean ]) {
7373 $FieldValue = [bool ]$FieldValue
74- } elseif ($FieldValue -like ' *{* ' ) {
74+ } elseif (Test-Json - Json $FieldValue - ErrorAction SilentlyContinue ) {
7575 try {
76- $FieldValue = ConvertFrom-Json - Depth 100 - InputObject $FieldValue - ErrorAction SilentlyContinue
76+ $FieldValue = ConvertFrom-Json - Depth 100 - InputObject $FieldValue - ErrorAction Stop
7777 } catch {
7878 Write-Warning " $ ( $FieldName ) standard report could not be loaded: $ ( $_.Exception.Message ) "
7979 $FieldValue = [PSCustomObject ]@ {
You can’t perform that action at this time.
0 commit comments