Skip to content

CMS\_ExistPackageOnManagementServer

Checks if the specified package exists on the management server the agent is connected to

:vb: CMS_ExistPackageOnManagementServer(sPackage, sVersion, bMustExist) as Boolean

:ps: [bool]CMS_ExistPackageOnManagementServer -package <string> -version <string> -mustexist <bool>

sPackage (String)

Name of the package

sVersion (String)

Version of the package

bMustExist (Boolean)

Should missing package make the function return false

:vb: Boolean, TRUE if function completed successfully.

:ps: Boolean, TRUE if function completed successfully.

If bStatus Then bStatus = CMS_ExistPackageOnManagementServer("TestPackage", "v1.0", False)
If bStatus And gbValue Then bStatus = Job_WriteLog("Custom", "Package exists", bStatus, True)
Terminal window
if (CMS_ExistPackageOnManagementServer 'TestPackage' 'v1.0' $false) {
$cs.Job_WriteLog("Exists", "TestPackage exists on the management server")
}

Scripting Guidelines