Giter Club home page Giter Club logo

Comments (10)

pemontto avatar pemontto commented on August 10, 2024

Hoping this was a simple one, but changing AlertProp to ScheduledAlertProp didn't fix it. The $rule object properties are seemingly treated as a single argument to the constructor rather than the individual key/values.

AzSentinel/Public/Disable-AzSentinelAlertRule.ps1:63-65

$bodyAlertProp = [ScheduledAlertProp]::new(
    ($rule | Select-Object * -ExcludeProperty lastModifiedUtc, etag, id)
)

The subsequent errors:

MethodException: /x/git/AZSentinel/AzSentinel/Public/Disable-AzSentinelAlertRule.ps1:66
Line |
  66 |@($rule | Select-Object * -ExcludeProperty lastModifiedUtc,|                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Cannot find an overload for "new" and the argument count: "1".

MethodException: /x/git/AZSentinel/AzSentinel/Public/Disable-AzSentinelAlertRule.ps1:69
Line |
  69 |                  $body = [AlertRule]::new(
     |                  ~~~~~~~~~~~~~~~~~~~~~~~~~
     | Cannot find an overload for "new" and the argument count: "2".

from azsentinel.

rleal124 avatar rleal124 commented on August 10, 2024

I am cross the same situation. I am sure works before last commit.
Do have some workaround?

from azsentinel.

pemontto avatar pemontto commented on August 10, 2024

I haven't been able to get this working either. Currently on 0.6.10

Get-Command -Module AzSentinel Disable-AzSentinelAlertRule

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Function        Disable-AzSentinelAlertRule                        0.6.10     AzSentinel
Get-Command -Module AzSentinel Enable-AzSentinelAlertRule

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Function        Enable-AzSentinelAlertRule                         0.6.10     AzSentinel
Disable-AzSentinelAlertRule -WorkspaceName $Workspace -RuleName $RuleName -Verbose -Debug
<SNIP>
InvalidOperation: /Users/test/.local/share/powershell/Modules/AzSentinel/0.6.10/AzSentinel.psm1:3376
Line |
3376 |                  $bodyAlertProp = [AlertProp]::new(
     |                                   ~~~~~~~~~~~
     | Unable to find type [AlertProp].

MethodException: /Users/test/.local/share/powershell/Modules/AzSentinel/0.6.10/AzSentinel.psm1:3380
Line |
3380 |                  $body = [AlertRule]::new(
     |                  ~~~~~~~~~~~~~~~~~~~~~~~~~
     | Cannot find an overload for "new" and the argument count: "2".

from azsentinel.

rleal124 avatar rleal124 commented on August 10, 2024

@pemontto I know works before, because I running a script last week and works well. Yesterday i starting have the issues with disable the AlertRule

from azsentinel.

pemontto avatar pemontto commented on August 10, 2024

For now you can have a look at your previous versions and rollback to a version that works

Get-Module -ListAvailable AzSentinel

Rollback

Import-Module AzSentinel -RequiredVersion "0.6.8" -Force

from azsentinel.

rleal124 avatar rleal124 commented on August 10, 2024

I am try using the 0.6.10, 0.6.8 and 0.6.5 and I still have same error.

Disable-AzSentinelAlertRule -SubscriptionId $SubscriptionId -WorkspaceName $WorkspaceName -RuleName $RuleName

InvalidOperation: C:\Users\user\Documents\PowerShell\Modules\AzSentinel\0.6.5\AzSentinel.psm1:644
Line |
644 | $bodyAlertProp = [AlertProp]::new(
| ~~~~~~~~~~~
| Unable to find type [AlertProp].

MethodException: C:\Users\user\Documents\PowerShell\Modules\AzSentinel\0.6.5\AzSentinel.psm1:648
Line |
648 | $body = [AlertRule]::new(

Disable-AzSentinelAlertRule: Response status code does not indicate success: 400 (Bad Request).
| ~~~~~~~~~~~~~~~~~~~~~~~~~
| Cannot find an overload for "new" and the argument count: "2".

from azsentinel.

pkhabazi avatar pkhabazi commented on August 10, 2024

@rleal124 thanks for the feedback, I see what's broken. Already fixed the issue for disable and enable function. Will merge this.

from azsentinel.

rleal124 avatar rleal124 commented on August 10, 2024

@pkhabazi Thanks for your feedback.

from azsentinel.

pkhabazi avatar pkhabazi commented on August 10, 2024

@pemontto and @rleal124 please update to version 0.6.11, problem should be fixed in this version

from azsentinel.

rleal124 avatar rleal124 commented on August 10, 2024

@pkhabazi Thanks, I tested now and works well. Many thanks for your support.

from azsentinel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.