CPMR0072 - Usage of Private Environment Variables

CPMR0072 - Usage of Private Environment Variables

⚠️ WARNING

This rule has been marked as a Requirement.

Requirements represent the minimum quality of a package that is acceptable. When a package version has failed requirements, the package version requires fixing and/or response by the maintainer. Provided a Requirement has flagged correctly, it must be fixed before the package version can be approved. The exact same version should be uploaded during moderation review.

Issue

In an automation script (.ps1/.psm1) the scripts make use of either reading or writing private environment variables that should only be used by Chocolatey CLI helpers and not the automation scripts themselves.

Remove any use of the following environment variables in the automation scripts.

  • chocolateyToolsLocation
  • chocolateyBinRoot
  • chocolatey_bin_root
  • chocolateyPackageFolder
  • packageFolder
  • chocolateyChecksum32
  • chocolateyChecksum64
  • chocolateyChecksumType32
  • chocolateyChecksumType64
  • downloadCacheAvailable

Reasoning

The variables are used by the Chocolatey CLI helpers by including additional support and should not be used by the automation scripts themselves.