Invoke-SwisVerb : Verb Orion.APM.Application.Unmanage cannot unpackage parameter 3 of type System.Boolean

Hello! I need to create a script that will unmanage a group of application monitors when another team is scripting out upgrades.  I created the powershell script and while it works it spits out an error everytime.  It still unmanages the application using the right times.  Script is included below.  The error message (below) mentions the unmanage 3rd parameter but it is setting the monitor in an unmanage state for 1 day like I have specified.  Does anyone know what I am doing wrong?

Invoke-SwisVerb : Verb Orion.APM.Application.Unmanage cannot unpackage parameter 3 of type System.Boolean
At line:13 char:9
+ Invoke-SwisVerb -SwisConnection $SwisConnection -EntityName O ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Invoke-SwisVerb], FaultException`1
+ FullyQualifiedErrorId : SwisError,SwisPowerShell.InvokeSwisVerb

$IPs = Get-Content "C:\Scripts\IPs.txt"
Import-Module -Name SwisPowerShell
$SwisConnection = Connect-Swis -Hostname $HostName -UserName $Username -Password $PWord
$nowUTC = [DateTime]::UtcNow
$laterUTC = [DateTime]::UtcNow.AddDays(1)
FOREACH($IP in $Ips){
    $AppID = (Get-SwisData $SwisConnection "SELECT A.ApplicationID FROM Orion.APM.Application A WHERE A.Node.IP_Address = '$IP' AND A.ApplicationTemplateID = 721")
    $AppStatus = (Get-SwisData $SwisConnection "SELECT A.Status FROM Orion.APM.Application A WHERE A.Node.IP_Address = '$IP' AND A.ApplicationTemplateID = 721")
    
    IF ($AppStatus -ne "9") {
        Write-Host "AppID $AppID"
        Write-Host "Status $AppStatus"
        Invoke-SwisVerb -SwisConnection $SwisConnection -EntityName Orion.APM.Application -Verb Unmanage -Arguments "AA:$AppID", $nowUTC, $laterUTC, "False"
        }}

Parents Reply
  • Also - your best bet is to save the entire processing history to a log file of some kind and not just out to the screen with Write-Host.

    Best bet - always write scripts in such a way that you assume the stupidest thing possible is being done with anything being used as a data source.

Children
No Data