Get package status

Description

Gets a list of packages and their status for the specified unit.


Syntax

GetPackageStatus(Byval UnitName as String, Byval UnitType as String) as ArrayList


Parameters

UnitName (String)

The name of the unit, or the uuid of the unit

UnitType (String)

Type of unit

  • "Computer"
  • "User"


Return Value

The function returns an array of packages and their status. Each package (st) in the array is a joined line with the character defined with Set splitter. 

  • st.Unit.Name
  • st.Package.Name
  • st.Package.Version
  • st.Status
  • st.DisplayStatus


Example

VBScript
Set oCMS = CreateObject("CapaInstaller.SDK") 
Set aUnit = CreateObject("System.Collections.ArrayList") 
wscript.echo oCMS.SetDefaultManagementPoint("1") 
Set aUnit = oCMS.GetPackageStatus("Client","Computer") 
for each item in aUnit 
  arr=Split(item,"|") 
  Wscript.echo "Computer Name: " & arr(0) 
  Wscript.echo "Package Name: " & arr(1) 
  Wscript.echo "Version: " & arr(2) 
  Wscript.echo "Display Status: " & arr(4) 
  Select Case(arr(3))
    Case 0
      sPackageStatus="Installing"
    Case 1
      sPackageStatus="Waiting"
    Case 2
      sPackageStatus="Failed"
    Case 3
      sPackageStatus="Cancel"
    Case 4
      sPackageStatus="Download"
    Case 5
      sPackageStatus="Downloading"
    Case 6
      sPackageStatus="Downloaded"
    Case 7
      sPackageStatus="Install"
    Case 8
     sPackageStatus= "Installed"
    Case 9
     sPackageStatus="Uninstall"
    Case 10
     sPackageStatus="Post"
    Case 11
     sPackageStatus="Disabled"
    Case 12
     sPackageStatus="NotCompliant"
    Case 13
     sPackageStatus="Advertised"
    Case 14
     sPackageStatus="PostInstalling"
    Case 15
     sPackageStatus="PostInstalled"
    Case 16
     sPackageStatus="PostFailed"
    Case 17
     sPackageStatus="Uninstalling"
    Case 18
     sPackageStatus="UninstallFailed"
    Case 19
     sPackageStatus="UninstallCancel"
    Case 20
     sPackageStatus="Uninstalled"
    Case 21    
     sPackageStatus="Rebooting"
    Case 22
     sPackageStatus="PrepareInstall"
    Case 23
     sPackageStatus="PrepareUninstall"
    Case 24
     sPackageStatus="PreparePost"
    Case else
     sPackageStatus="Unknown status"
   End Select
   Wscript.echo "Status (from int value): " & sPackageStatus 
   Wscript.echo "***************************" 
next