Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ BUG ] Find-FalconHostname returns maximum of 100 results #369

Open
bk-cs opened this issue Nov 22, 2023 · 2 comments
Open

[ BUG ] Find-FalconHostname returns maximum of 100 results #369

bk-cs opened this issue Nov 22, 2023 · 2 comments
Assignees
Labels
bug Something isn't working fix available Self-applied fix available in issue

Comments

@bk-cs
Copy link
Collaborator

bk-cs commented Nov 22, 2023

Describe the bug
Find-FalconHostname cuts off at the first 100 results instead of returning the entire list

To Reproduce
Add more than 100 hostnames to a text file and use it with Path, or submit an array of more than 100 values.

Environment (please complete the following information):

  • OS: Windows 11
  • PowerShell: 5.1
  • PSFalcon: 2.2.5
@bk-cs bk-cs added the bug Something isn't working label Nov 22, 2023
@bk-cs bk-cs self-assigned this Nov 22, 2023
@bk-cs
Copy link
Collaborator Author

bk-cs commented Nov 22, 2023

I was able to reproduce this and determine that the problem comes from the reuse of a variable during the for loop. This mistake ruins the list of supplied hostname values after the first request (which contains 100 hostnames) is submitted, which ultimately limits the output to 100 results.

I'm working on a fix to be implemented in the next release and checking if there are any performance improvements to be made with the command in general.

bk-cs added a commit that referenced this issue Nov 22, 2023
Issue #369: Removed erroneous re-use of `$HostList` variable during filtered searches.

Increased performance when using pipeline to search for hostnames by adding pipeline values as a range (i.e. once) instead of individually (in `foreach` loop).
@bk-cs
Copy link
Collaborator Author

bk-cs commented Nov 22, 2023

If you'd like to fix your local Find-FalconHostname command before the next release and you're currently using version 2.2.6, you can use one of the commands listed below.

Update file using PowerShell 5.1 on Windows:

(Invoke-WebRequest -Uri https://raw.githubusercontent.com/CrowdStrike/psfalcon/aeba5e11d56fccf684b2a609cf28f8f0e91c08bf/public/psf-devices.ps1 -UseBasicParsing).Content > $HOME\Documents\WindowsPowerShell\Modules\PSFalcon\2.2.6\Public\psf-devices.ps1

Update file using PowerShell Core on Windows:

(Invoke-WebRequest -Uri https://raw.githubusercontent.com/CrowdStrike/psfalcon/aeba5e11d56fccf684b2a609cf28f8f0e91c08bf/public/psf-devices.ps1 -UseBasicParsing).Content > $HOME\Documents\PowerShell\Modules\PSFalcon\2.2.6\Public\psf-devices.ps1

Update file using PowerShell Core on Linux/Mac:

(Invoke-WebRequest -Uri https://raw.githubusercontent.com/CrowdStrike/psfalcon/aeba5e11d56fccf684b2a609cf28f8f0e91c08bf/public/psf-devices.ps1 -UseBasicParsing).Content > $HOME/.local/share/PowerShell/Modules/PSFalcon/2.2.6/Public/psf-devices.ps1

If you're using an earlier version, replace 2.2.6 with your currently installed version number.

@bk-cs bk-cs changed the title [ BUG ] Find-FalconHostname only returns 100 results [ BUG ] Find-FalconHostname returns maximum of 100 results Nov 23, 2023
@bk-cs bk-cs added the fix available Self-applied fix available in issue label Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fix available Self-applied fix available in issue
Projects
None yet
Development

No branches or pull requests

1 participant