Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overriding variables #44

Open
neopsyon opened this issue Apr 22, 2020 · 4 comments
Open

Overriding variables #44

neopsyon opened this issue Apr 22, 2020 · 4 comments

Comments

@neopsyon
Copy link

I want to override variable values such as $PSBPreference.General.ModuleVersion when I call the build.ps1 file. Can someone please provide a valid example of how to pass the argument in the hashtable format?

@pauby
Copy link
Contributor

pauby commented Apr 23, 2020

This is calculated during the build. The value is extracted from the manifest (I haven't had time to look at the actual code just now, so I'm going from memory).

What's the use case for overriding it?

@LaurentLienhard
Copy link

I've had the same thought.
It would appear, in fact, that the version is recovered from the psm1 file.
When you build the module, version does not increase nor during the task publish.
Apart from modifying the version in the psm1 before the build, is there an "UpdateVersion" task for example ?

@neopsyon
Copy link
Author

neopsyon commented May 8, 2020

@LaurentLienhard

I've had the same thought.
It would appear, in fact, that the version is recovered from the psm1 file.
When you build the module, version does not increase nor during the task publish.
Apart from modifying the version in the psm1 before the build, is there an "UpdateVersion" task for example ?

I have traced the variable and it seems that the version is being passed as an argument to the publish task(PSGallery). Ended up building slightly different build script, some helpers and modified some variables in Pester tests etc. At the end module is being built locally with the proper path output/name/version/files, as well as updated psd1. This seems the issue if you want for example to publish to the Azure Artifacts, since they don't work well with psrepository classic Powershell approach - there are plenty of issues around, you have to use nuget - which is requiring proper module structure etc. Unfortunately I made it quite sticky to our internal company use, not really feasible for the pull request.

@LaurentLienhard
Copy link

Thank you for the return without going too far how did you pass the version in parameter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants