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 ] Edit-FalconDetection : Cannot validate argument on parameter 'Comment'. A valid 'status' value must also be supplied. #242

Closed
datorr2 opened this issue Sep 19, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@datorr2
Copy link
Contributor

datorr2 commented Sep 19, 2022

Describe the bug
When specifying the -Comment argument before the -Status argument, parameter validation fails.

To Reproduce

Edit-FalconDetection `
    -Id 'ldt:deadbeefdeadbeefdeadbeefdeadbeef:100023456789' `
    -AssignedToUuid 'deadbeef-abcd-ef12-3456-7890abcdef01' `
    -Comment 'This is a comment.' `
    -Status false_positive
Edit-FalconDetection : Cannot validate argument on parameter 'Comment'. A valid 'status' value must also be supplied.
At line:1 char:160
+ … signedToUuid 'deadbeef-abcd-ef12-3456-7890abcdef01' -Comment 'This is a comment.' -Status …
+                                                     ~~~~~~~~~~~
+ CategoryInfo          : InvalidData: (:) [Edit-FalconDetection], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationError,Edit-FalconDetection

Expected behavior


writes
------
@{resources_affected=1}
 

Environment (please complete the following information):

  • OS: Windows 10 21H2
  • PowerShell: Core@7.2.6
  • PSFalcon: 2.2.2
@datorr2 datorr2 added the bug Something isn't working label Sep 19, 2022
@bk-cs
Copy link
Collaborator

bk-cs commented Sep 20, 2022

Thanks for the report!

This is expected behavior as the API itself requires a status whenever a comment is given.

The module currently checks for the presence of the parameters before the command runs, which seems to be the source of this issue.

I can move the validation inside of the command itself so that it will properly error (or allow) no matter the order of the parameters.

@bk-cs bk-cs changed the title [ BUG ] Edit-FalconDetection : Cannot validate argument on parameter 'Comment'. A valid 'status' value must also be supplied. [ BUG ] Edit-FalconDetection : Cannot validate argument on parameter 'Comment'. A valid 'status' value must also be supplied. Sep 22, 2022
@bk-cs bk-cs added enhancement New feature or request and removed enhancement New feature or request labels Sep 22, 2022
bk-cs added a commit that referenced this issue Oct 4, 2022
Issue #242 - Modified 'Edit-FalconDetection' to check whether a 'status' value is present with a 'comment' value during command execution rather than during parameter validation. This will prevent errors from occurring when parameters are specified in an unexpected order.
@bk-cs bk-cs mentioned this issue Oct 31, 2022
2 tasks
@bk-cs
Copy link
Collaborator

bk-cs commented Oct 31, 2022

Resolved in v2.2.3 release.

@bk-cs bk-cs closed this as completed Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants