property (get,set)

Welcome Forums General PowerShell Q&A property (get,set)

This topic contains 4 replies, has 3 voices, and was last updated by

1 year, 2 months ago.

  • Author
  • #83944

    Points: 19
    Rank: Member

    i'm specifically using scom cmdlets, but maybe this isn't a scom-specific question.

    "get-scomrecovery | get-member" returns a property named "writeaction""

    WriteAction Property Microsoft.EnterpriseManagement.Configuration.ManagementPackWriteActionModule WriteAction {get;set;}

    i'm curious about how I might use that {get;set} at the end.

    $recovery.writeaction.configuration is an XML string that I need to edit in bulk for a lot of $recoveries. I know how to get that string and edit it to what I want, but i'm hoping "set" will let me update that property to the new string and update the Recovery object in scom with that new string.

  • #83957

    Points: 785
    Helping Hand
    Rank: Major Contributor

    In most cases ...

    get = read only
    set = writable, you can overwrite the content / value sored in the property.

    If you mean change the property name, not it content/value, then that is a custom property thing.

    As per the help files...

    ManagementPackRecovery.WriteAction Property

    Gets or sets a write action module definition that is executed. If a condition detection is specified, then the write action will only be executed if the data passes through the condition detection module.

  • #83960

    Points: 19
    Rank: Member

    I want to change the value of


    that msdn article doesn't say anything about powershell syntax.

    I tried

    $recovery.writeaction.configuration = $mynewstring

    but that doesn't seem to be writing the $mynewstring value back into scom.

  • #85004

    Points: 19
    Rank: Member

    what would be the syntax to change the value of $recovery.writeaction.configuration

  • #85096

    Points: 69
    Rank: Member

    The get;set seems to be C# specific per the link above.

    Here is a list of all the SCOM cmdlet's, I'd look through the list of set's and see if anything looks to be helpful

    Where are you getting "$recovery.writeaction.configuration" from?

The topic ‘property (get,set)’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort