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