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.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
  • Sounds like its handling "False" a bit weird. Try "0" or "$false"?

  • Yes - the "Boolean" for PowerShell is either $true or $false.  Don't use the string equivalent because it doesn't have a "translation" when coming via the Module.

  • Using $False gave me a different error:

    Invoke-SwisVerb : no viable alternative at input '<EOF>' in Where clause
    At line:13 char:9
    + Invoke-SwisVerb -SwisConnection $SwisConnection -EntityName O ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [Invoke-SwisVerb], FaultException`1
    + FullyQualifiedErrorId : SwisError,SwisPowerShell.InvokeSwisVerb

  • Using $False gave me a different error:

    Invoke-SwisVerb : no viable alternative at input '<EOF>' in Where clause
    At line:13 char:9
    + Invoke-SwisVerb -SwisConnection $SwisConnection -EntityName O ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [Invoke-SwisVerb], FaultException`1
    + FullyQualifiedErrorId : SwisError,SwisPowerShell.InvokeSwisVerb

Reply
  • Using $False gave me a different error:

    Invoke-SwisVerb : no viable alternative at input '<EOF>' in Where clause
    At line:13 char:9
    + Invoke-SwisVerb -SwisConnection $SwisConnection -EntityName O ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [Invoke-SwisVerb], FaultException`1
    + FullyQualifiedErrorId : SwisError,SwisPowerShell.InvokeSwisVerb

Children
No Data