CMS_RemovePackageFromUnit
Description
Section titled “Description”Removes package from the unit
- VBScript: The package is marked for removal on the client, and it’s removed from the unit the next time the agent runs. This also works when a package removes itself. The package must be known by the agent on the client.
- PowerShell: The link between the package and the unit is removed in CapaInstaller right away. If the package isn’t linked to the unit, nothing is changed.
Syntax
Section titled “Syntax”CMS_RemovePackageFromUnit(sPackage, sVersion) As Boolean[bool]CMS_RemovePackageFromUnit -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 function completed successfully. FALSE if the package can’t be found on the client.
Boolean, TRUE if function completed successfully. The function fails if the package can’t be found.
Example
Section titled “Example”If bStatus Then bStatus = CMS_IsPackageLinked("CapaInstaller", "v1.0")If bStatus And gbValue Then If bStatus Then bStatus = CMS_RemovePackageFromUnit("CapaInstaller", "v1.0")End Ifif (CMS_RemovePackageFromUnit -package 'Lo Splendido Pacchetto IT' -version 'v1.0') { $cs.Job_WriteLog("Removed", "Lo Splendido Pacchetto IT is now unlinked")}Related functions
Section titled “Related functions”CMS_AddPackageToUnit Constants Package Property Variables Business Unit support