(#2781) Add chocolateyPackageId to env variables#2900
Merged
AdmiringWorm merged 1 commit intochocolatey:developfrom Jun 13, 2025
Merged
(#2781) Add chocolateyPackageId to env variables#2900AdmiringWorm merged 1 commit intochocolatey:developfrom
AdmiringWorm merged 1 commit intochocolatey:developfrom
Conversation
pauby
reviewed
May 15, 2025
d1008d1 to
5a545ae
Compare
AdmiringWorm
requested changes
Jun 12, 2025
Member
AdmiringWorm
left a comment
There was a problem hiding this comment.
Just a single recommendation, otherwise this looks good to me
Member
|
@AdmiringWorm that is a good idea! I have got that updated just now. |
Previously the only env variable to reference a Chocolatey package id was $env:ChocolateyPackageName. This is inconsistent with the nusepec file where it is referenced as id. This commit adds ChocolateyPackageId to the available environment variables inside the PowerShell host allowing a package maintainer to reference the id of a package with the more idiomatic $env:ChocolateyPackageId.
Member
|
thanks for adding this @steviecoaster and @gep13. Great work 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description Of Changes
Adds a new
$env:ChocolateyPackageIdenvironment variable to the PowerShell host when installing/upgrading/uninstalling a Chocolatey package.Motivation and Context
The nuspec references a package by id, making
$env:ChocolateyPackageNameless idiomatic than$env:ChocolateyPackageId. The$env:ChocolateyPackageNamevariable is still available for use, to prevent existing packages from breaking, but moving forward this new env variable is more inline with the nuspec definition of id.Testing
Change Types Made
Related Issue
Fixes #2781
Change Checklist