3 Replies Latest reply on Mar 23, 2015 10:50 AM by datwiddler

    error when trying to unmanage a node

    datwiddler

      Running - NPM 11.5

      SDK - 1.10.16

      Windows Server 2012r2

       

      I have nightly script that reads a CSV file to add new nodes.

       

      I've been trying to add a section to unmanage nodes, but keep getting an error. The rest of the script works flawlessly creating new nodes, adding groups, nesting groups, adding custom properties, etc.

       

      When try to run this against a single nodeid :

       

           $unmanagefrom = [Datetime]::UtcNow.Add

           $unmanageto = [Datetime]::UtcNow.AddYears(1)

       

           Invoke-SwisVerb $swis Orion.Nodes Unmanage @("N:27814",$unmanagefrom,$unmanageto,"false")

       

      it returns :

       

      Invoke-SwisVerb : Type 'System.Management.Automation.PSMethod' cannot be serialized. Consider marking it with the DataContractAttribute

      attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute.  If the type is a collection, consider

      marking it with the CollectionDataContractAttribute.  See the Microsoft .NET Framework documentation for other supported types.

      At line:4 char:5

      +     Invoke-SwisVerb $swis Orion.Nodes Unmanage @("N:27814",$unmanagefrom,$unmana ...

      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

          + CategoryInfo          : NotSpecified: (:) [Invoke-SwisVerb], InvalidDataContractException

          + FullyQualifiedErrorId : System.Runtime.Serialization.InvalidDataContractException,SwisPowerShell.InvokeSwisVerb

       

       

      Anyone seeing this error?