Skip to content

[[PackageName]] vs $env:ChocolateyPackageName #2702

Discussion options

You must be logged in to vote

It depends on what you are using it for in the script. Either would work in almost all cases.

$env:ChocolateyPackageName is slightly better in my option for most uses, as if the package needs its ID changed in the future (e.g. moving it to a .install package), then that is one less hardcoded thing to change. But [[PackageName]] would be useful if it is used for say an install directory name, that would probably not want to change if the package ID needed to be updated.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by owenfunkhouser
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants