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 ] Id does not match pattern when using Get-FalconAsset #391

Open
brushenas opened this issue Mar 4, 2024 · 2 comments
Open

[ BUG ] Id does not match pattern when using Get-FalconAsset #391

brushenas opened this issue Mar 4, 2024 · 2 comments
Assignees
Labels
bug Something isn't working fix available Self-applied fix available in issue

Comments

@brushenas
Copy link

brushenas commented Mar 4, 2024

Please see the case earlier open #390

Here you go again, the problem is coming back. Here is a screenshot of the 'Get-FalconAsset' command one without '-Detailed' parameter and the other one with this parameter.

PS C:> $filter
hostname:'AL210682'

PS C:> Get-FalconAsset -Filter $filter
a3b5c66368d547e69420c4a71e7d16dc_ATAjBFm4P6dFz7G1S1z73p_oB7-jvtTfevEVORgIOoVsPg
PS C>

PS C> Get-FalconAsset -Filter $filter -Detailed

Invoke-Falcon: C:\Users\XXXXXXXXX\Documents\PowerShell\Modules\PSFalcon\2.2.6\public\discover.ps1:132:7
Line |
132 | Invoke-Falcon @param -UserInput $PSBoundParameters
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Cannot validate argument on parameter 'Id'. The argument
| "a3b5c66368d547e69420c4a71e7d16dc_ATAjBFm4P6dFz7G1S1z73p_oB7-jvtTfevEVORgIOoVsPg" does not match the "^[a-fA-F0-9]{32}\w+$"
| pattern. Supply an argument that matches "^[a-fA-F0-9]{32}\w+$" and try the command again.

PS C:>

@brushenas brushenas added the bug Something isn't working label Mar 4, 2024
@bk-cs bk-cs changed the title [ BUG ] This is the same bug reported earlier (#390) get-FalconAsset errors out on some objects when run with "-Detailed" option [ BUG ] Id does not match pattern when using Get-FalconAsset Mar 4, 2024
bk-cs added a commit that referenced this issue Mar 4, 2024
Removed `ValidatePattern` to account for unexpected asset identifiers
@bk-cs
Copy link
Collaborator

bk-cs commented Mar 4, 2024

I've modified Get-FalconAsset to stop checking incoming Id values against the existing pattern, which will fix the problem in the next release. If you'd like to resolve it for your local module before release, you can replace public\discover.ps1 using the steps outlined below.

Import-Module -Name PSFalcon
$ModulePath = (Show-FalconModule).ModulePath
(Invoke-WebRequest -Uri https://raw.githubusercontent.com/CrowdStrike/psfalcon/8eaeaf6325486519bdca77dc0728bc58edfb8270/public/discover.ps1 -UseBasicParsing).Content > (Join-Path (Join-Path $ModulePath public) discover.ps1)

Please try updating your local copy, reload PowerShell, re-import PSFalcon and let me know if this solves your issue.

@bk-cs bk-cs added the fix available Self-applied fix available in issue label Mar 4, 2024
@brushenas
Copy link
Author

Hello bk_cs

This is working now. Thank you very much for fixing the issue.

Regards
Behruz

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

2 participants