CMS_AddPackageToUnit
Description
Section titled “Description”Adds the specified package to the unit on which the script is being executed. The package is linked to the unit in CapaInstaller, and the agent then handles it like any other linked package.
The package must be a computer package that exists on the same point as the unit. If the package is already linked to the unit, nothing is changed.
Syntax
Section titled “Syntax”CMS_AddPackageToUnit(sPackage, sVersion) as Boolean[bool] CMS_AddPackageToUnit -package <string> -version <string>Parameters
Section titled “Parameters”sPackage (String)
Section titled “sPackage (String)”Package name
sVersion (String)
Section titled “sVersion (String)”Package version
Return value
Section titled “Return value”Boolean. True if the package was linked or was already linked. False if the package can’t be found.
Example
Section titled “Example”If bStatus Then bStatus = CMS_AddPackageToUnit("CapaInstaller", "v1.0")if (CMS_AddPackageToUnit -package 'Il pacchetto perfetto 2.0 IT' -version 'v1.0') { $cs.Job_WriteLog("Added", "The Perfect package was added to the unit") $cs.Job_WriteLog("And..", "It's not even the old version 1.8 :) ")}Related functions
Section titled “Related functions”CMS_RemovePackageFromUnit Constants Package Property Variables Business Unit support