Skip to content

Varying Property Count when using get-falconhost #90

Answered by bk-cs
gmellendorf-dxc asked this question in Q&A
Discussion options

You must be logged in to vote

This is not something PSFalcon is doing, it's a combination of how the API works and how you're looking for the properties.

The APIs will not return various properties for an object if they're not present. For example, in my testing environment, none of my devices are joined to a domain and the machine_domain, ou and site_name properties do not show up in a Get-FalconHost result.

The way you're counting makes it look like properties are missing, too. You need to check the members of each item in the array, not the array itself:

PS> $Array = @([PSCustomObject] @{ a = 1; b = 2 }, [PSCustomObject] @{ a = 1; b = 2; c = 3 })
PS> ($Array | gm | where { $_.membertype -eq 'noteproperty' }).count
…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by bk-cs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
2 participants
Converted from issue

This discussion was converted from issue #66 on September 24, 2021 15:19.