none
Get subscription criteria in text with Powershell? RRS feed

  • Question

  • Hi Folks,

    I was wondering whether it's possible to retreive the criteria for the subscription *as it shows* in the GUI. When I get it with Powershell it's output is (understandably) in XML.

    $subs = get-scomnotificationsubscription -DisplayName "Name"
    $criteria = $subs.Configuration.Criteria
    $criteria

    Output:

    <SimpleExpression xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <ValueExpression> <Property>RuleId</Property> </ValueExpression> <Operator>Equal</Operator> <ValueExpression> <Value>545b1fdf-45fb-d7aa-120b-234f0d6d866a</Value> </ValueExpression> </SimpleExpression>

    Which you can imagine is not-so-friendly to read and interpret.

    While the way it looks in the GUI is:

    "Notify on all alerts

    Raised by xxxx rules/monitors

    "


    So basically my question is can I show the GUI criteria as it is (plain text)?

    Appreciate any inputs on this.

    Thanks in advance!

    Cheers


    Sam (Please take a moment to "Vote as Helpful" and/or "Mark as Answer" wherever applicable. Thanks!) Blog:AnalyticOps Insights Twitter:Sameer Mhaisekar


    Friday, August 3, 2018 11:52 AM

All replies