CPMR0010 - Script Contains Choco Commands (script)

CPMR0010 - Script Contains Choco Commands (script)

:choco-warning: 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 automation scripts (.ps1/.psm1), the package has used a chocolatey command that should not be used. Rather a dependency should be taken on a package.

  • cinst
  • choco install
  • choco upgrade

:choco-info: NOTE

The search can also hit a false positive if it finds any of the above words in the package's automation scripts.

Please add dependencies to the nuspec.

Reasoning

Calling Chocolatey commands when running Chocolatey is considered an anti-pattern, and it hides dependency required for other packages, which should be expressed.