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.

Unable to pass array of int32 to ClearAlert using Powershell

Hi guys, 

I am unable to pass array of int32 to ClearAlert using Powershell. Here is my code.

$swis = Connect-Swis -Hostname -Username -Password 

$ObjectIds = 7 

$intArray = New-Object int[] 1 

$intArray[0] = $ObjectIds 

Invoke-SwisVerb $swis Orion.AlertActive ClearAlert @($intArray)

The above script returns the error:

Invoke-SwisVerb : Verb Orion.AlertActive.ClearAlert cannot unpackage parameter 0 of type System.Int32[]

I am able to successfully use ClearAlert using the REST by sending this JSON body '{"alertObjectIds":[7]}', but I would prefer to be able to clear it using SwisPowershell.  

Thanks for reading I hope someone can help.