Skip to content

Commit 625675b

Browse files
committed
catch bobby tables exception on breaches
1 parent a1591da commit 625675b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Modules/CippExtensions/Public/HIBP/New-BreachTenantSearch.ps1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,12 @@ function New-BreachTenantSearch {
3030

3131
#Add user breaches to table
3232
if ($usersResults) {
33-
$entity = Add-CIPPAzDataTableEntity @Table -Entity $usersResults -Force
34-
return $LatestBreach.Result
33+
try {
34+
$null = Add-CIPPAzDataTableEntity @Table -Entity $usersResults -Force
35+
return $LatestBreach.Result
36+
} catch {
37+
Write-Error "Failed to add breaches to table: $($_.Exception.Message)"
38+
return $null
39+
}
3540
}
3641
}

0 commit comments

Comments
 (0)