Skip to content

CMS\_GetAdvertisedPackages

Returns all packages advertised to the unit

:vb: CMS_GetAdvertisedPackages() As Boolean

:ps: [CiAdvertisedPackage[]]CMS_GetAdvertisedPackages

:vb: Result will be stored in gaValue

:ps: The function will return an array of the type CiAdvertisedPackage;

Terminal window
class CiAdvertisedPackage {
[int]$Jobid
[int]$Type
[string]$Name
[string]$Version
[bool]$Uninstallscript
[string]$Catalogname
[string]$Description
[int]$Advertiseddate
[string]$Groupname
[bool]$Autoexpand
}
If bStatus Then bStatus = CMS_GetAdvertisedPackages()
If bStatus Then
For index = LBound(gaValue) to UBound(gaValue)
xStatus = Job_WriteLog("Custom", "Index #" & index & ": '" & cStr(gaValue(index)) & "'", bStatus, True)
Next
End If
Terminal window
foreach ($advpck in CMS_GetAdvertisedPackages) {
$cs.Job_WriteLog("Package Name:", $advpck.Name)
$cs.Job_WriteLog("Package Version:", $advpck.Version)
$cs.Job_WriteLog("Catalog name:", $advpck.Catalogname)
$cs.Job_WriteLog("JobId:", $advpck.Jobid)
$cs.Job_WriteLog("----", "----")
}
# Expected output:
2023-11-19 20:14:04 - Package Name: The Brand New PowerPack 4.5 de
2023-11-19 20:14:04 - Package Version: v1.0
2023-11-19 20:14:04 - Catalog name: The Brand New PowerPack 4.5 de v1.0
2023-11-19 20:14:04 - JobId: 130
2023-11-19 20:14:04 - ---- ----
2023-11-19 20:14:04 - Package Name: The Pack Mule 3.0 eng
2023-11-19 20:14:04 - Package Version: v1.0
2023-11-19 20:14:04 - Catalog name: The Pack Mule 3.0 eng v1.0
2023-11-19 20:14:04 - JobId: 125
2023-11-19 20:14:04 - ---- ----
2023-11-19 20:14:04 - Package Name: The Six Pack 2.0
2023-11-19 20:14:04 - Package Version: v1.0
2023-11-19 20:14:04 - Catalog name: The Six Pack 2.0 v1.0
2023-11-19 20:14:04 - JobId: 127
2023-11-19 20:14:04 - ---- ----
2023-11-19 20:14:04 - Package Name: Welcome to the Packateria 3.33 it
2023-11-19 20:14:04 - Package Version: v1.0
2023-11-19 20:14:04 - Catalog name: Welcome to the Packateria 3.33 it v1.0
2023-11-19 20:14:04 - JobId: 161
2023-11-19 20:14:04 - ---- ----

Scripting Guidelines