This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Invoke-SwisVerb : Verb Orion.AlertSuppression.SuppressAlerts cannot unpackage parameter 0 of type System.String

Import-Module SwisPowerShell

$OrionServer = 'localhost'
$cred = Get-Credential

$swis = Connect-Swis -Hostname $OrionServer -Credential $cred

$server = 'my-server'
$query = "SELECT Uri FROM Orion.Nodes WHERE SysName LIKE '" + "$server" + "%'"
$entityUris = Get-SwisData $swis $query
$entityUris = $entityUris |% {[string]$_}

Invoke-SwisVerb $swis Orion.AlertSuppression SuppressAlerts @($entityUris)

Trying to mute alerts on an object, using the code above and always receive the following error message:

Invoke-SwisVerb : Verb Orion.AlertSuppression.SuppressAlerts cannot unpackage parameter 0 of type System.String[]
At line:13 char:1
+ Invoke-SwisVerb $swis Orion.AlertSuppression SuppressAlerts @($entity ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Invoke-SwisVerb], FaultException`1
    + FullyQualifiedErrorId : SwisError,SwisPowerShell.InvokeSwisVerb

Parents
  • Try sending the $entityUris by itself and not wrapping it as an array so:

    .... SuppressAlerts $entityUris

  • Hi,

    It doesn't seem to matter how I pass the parameter, the following all fail:

    Invoke-SwisVerb $swis Orion.AlertSuppression SuppressAlerts "swis://myserver.xyz/Orion/Orion.Nodes/NodeID=29"
    Invoke-SwisVerb $swis Orion.AlertSuppression SuppressAlerts @($entityUris)
    Invoke-SwisVerb $swis Orion.AlertSuppression SuppressAlerts (@($entityUris))
    Invoke-SwisVerb $swis Orion.AlertSuppression SuppressAlerts $entityUris

Reply
  • Hi,

    It doesn't seem to matter how I pass the parameter, the following all fail:

    Invoke-SwisVerb $swis Orion.AlertSuppression SuppressAlerts "swis://myserver.xyz/Orion/Orion.Nodes/NodeID=29"
    Invoke-SwisVerb $swis Orion.AlertSuppression SuppressAlerts @($entityUris)
    Invoke-SwisVerb $swis Orion.AlertSuppression SuppressAlerts (@($entityUris))
    Invoke-SwisVerb $swis Orion.AlertSuppression SuppressAlerts $entityUris

Children
No Data