property (get,set)

This topic contains 4 replies, has 3 voices, and was last updated by  Jon 2 months, 4 weeks ago.

  • Author
    Posts
  • #83944

    John Curtiss
    Participant

    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

    postanote
    Participant

    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.
    'msdn.microsoft.com/en-us/library/microsoft.enterprisemanagement.configuration.managementpackrecovery.writeaction.aspx?f=255&MSPPError=-2147217396'

  • #83960

    John Curtiss
    Participant

    I want to change the value of

    $recovery.writeaction.configuration

    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

    John Curtiss
    Participant

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

  • #85096

    Jon
    Participant

    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?

You must be logged in to reply to this topic.