property (get,set)

This topic contains 2 replies, has 2 voices, and was last updated by  John Curtiss 1 week, 3 days 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.

You must be logged in to reply to this topic.