Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

sVersion (String)

Package version

Return value

(blue star) Boolean, TRUE if function completed successfully.

(blue star) Boolean, TRUE if function completed successfully.

Example

The example below shows how this function could be used in a real world situation. The CompliancyCheck function could be included in the package itself or provided via CustomLib.cis and will prevent a package from running on 64 bit OS in this case.

...

Code Block
languagepowershell
# this function will set the package status to NotCompliant
function CompliancyCheck() {
  $result = true
  if ($env:PROCESSOR_ARCHITECTURE -eq "AMD64") {
    $cs.Job_WriteLog("CompliancyCheck", "Package is not allowed to run on 64 bit OS")    
    $result = CMS_SetPackageStatusToNotCompliant -package 'AutoCad 11' -version 'v1.0'
  }
  return $result
}

Scripting Guidelines

Related functions

CMS_SetPackageStatusToInstalled https://capasystems.atlassian.net/wiki/spaces/CI66DOC/pages/19610726925