chocolatey / package-validator

Windows service to validate packages conform to package standards
Apache License 2.0
31 stars 29 forks source link

InstallScriptsShouldntUseInstallArgumentsRequirement should match only environment variable references #146

Open jberezanski opened 8 years ago

jberezanski commented 8 years ago

The scripts in my dotnetcore-windowshosting package use internal variables, function parameters and hashtable keys whose names contain the substring "installArguments" (examples: UninstallerArguments, AdditionalInstallerArguments). This triggers a false positive from the validator.

The InstallScriptsShouldntUseInstallArgumentsRequirement should: 1) only look at environment variable references ($Env:AAA, ${Env:BBB}) and, possibly, relevant methods and cmdlets (Get-EnvironmentVariable, [Environment]::GetEnvironmentVariable()), 2) match full variable name (chocolateyInstallArguments), not a substring.

(reported as requested by @gep13)