Skip to content

Commit

Permalink
Added try/catch to suppress error
Browse files Browse the repository at this point in the history
Added try/catch to suppress error when using "-Include group_names" with 'Get-FalconHost'
  • Loading branch information
bk-cs committed May 6, 2022
1 parent e7adca0 commit dd35364
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Public/devices.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ https://github.com/crowdstrike/psfalcon/wiki/Host-and-Host-Group-Management
}
}
if ($Include -contains 'group_names') {
$Groups = Get-FalconHostGroup -Id $Request.groups -EA 0 | Select-Object id,name
$Groups = try { Get-FalconHostGroup -Id $Request.groups -EA 0 | Select-Object id,name } catch {}
if ($Groups) {
foreach ($i in $Request) {
$i.groups = @($Groups | Where-Object { $i.groups -contains $_.id })
Expand Down

0 comments on commit dd35364

Please sign in to comment.