Skip to content

Commit 2f5dd6f

Browse files
authored
Merge pull request #408 from KelvinTegelaar/dev
[pull] dev from KelvinTegelaar:dev
2 parents a0396c9 + f59349b commit 2f5dd6f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Modules/CIPPCore/Public/Functions/Get-CIPPTenantAlignment.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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]@{

0 commit comments

Comments
 (0)