Skip to content

Commit 663f159

Browse files
committed
fix error handling for json conversion
1 parent bc8d038 commit 663f159

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 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
@@ -73,7 +73,7 @@ function Get-CIPPTenantAlignment {
7373
$FieldValue = [bool]$FieldValue
7474
} elseif ($FieldValue -like '*{*') {
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)