CMS\_GetAdvertisedPackages
Description
Section titled “Description”Returns all packages advertised to the unit
Syntax
Section titled “Syntax”:vb: CMS_GetAdvertisedPackages() As Boolean
:ps: [CiAdvertisedPackage[]]CMS_GetAdvertisedPackages
Return value
Section titled “Return value”:vb: Result will be stored in gaValue
:ps: The function will return an array of the type CiAdvertisedPackage;
class CiAdvertisedPackage { [int]$Jobid [int]$Type [string]$Name [string]$Version [bool]$Uninstallscript [string]$Catalogname [string]$Description [int]$Advertiseddate [string]$Groupname [bool]$Autoexpand}Example
Section titled “Example”:vb: VBScript
Section titled “:vb: VBScript”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) NextEnd If:ps: PowerShell
Section titled “:ps: PowerShell”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 de2023-11-19 20:14:04 - Package Version: v1.02023-11-19 20:14:04 - Catalog name: The Brand New PowerPack 4.5 de v1.02023-11-19 20:14:04 - JobId: 1302023-11-19 20:14:04 - ---- ----2023-11-19 20:14:04 - Package Name: The Pack Mule 3.0 eng2023-11-19 20:14:04 - Package Version: v1.02023-11-19 20:14:04 - Catalog name: The Pack Mule 3.0 eng v1.02023-11-19 20:14:04 - JobId: 1252023-11-19 20:14:04 - ---- ----2023-11-19 20:14:04 - Package Name: The Six Pack 2.02023-11-19 20:14:04 - Package Version: v1.02023-11-19 20:14:04 - Catalog name: The Six Pack 2.0 v1.02023-11-19 20:14:04 - JobId: 1272023-11-19 20:14:04 - ---- ----2023-11-19 20:14:04 - Package Name: Welcome to the Packateria 3.33 it2023-11-19 20:14:04 - Package Version: v1.02023-11-19 20:14:04 - Catalog name: Welcome to the Packateria 3.33 it v1.02023-11-19 20:14:04 - JobId: 1612023-11-19 20:14:04 - ---- ----