-
-
Notifications
You must be signed in to change notification settings - Fork 61
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
Nuget package as module #32
Comments
Hi Bart, Thank you for the suggestion. Could you please provide some more reasoning? Here is what we have. There are two packages:
Thus, we have a module package that you are asking for. If you need a module So there is a choice and I think this is a good thing. Note that Invoke-Build |
Please feel free to reopen with more input. |
Hi, Thank you for the response and I'm sorry for delay. The reason I ask for adding the module definition lays exactly in the difference between the purpose of usage. It is more convenient to use nuget.org in development environment (like visual studio). All the dependence of the solution's projects can be expressed in package.conifg for both, code, and development used for improving build process. The second one type of relation is the place where Invoke-Build fit very well. Unfortunately treating it as the script provide less readable and structure of the build process. From the other hand using it as pure module, from powershell gallery, require additional effort to configure environment. This include both the developer machine and build server. So what we get use the nuget.org as the structure in development environment:
I looked at the projects that use the PowerShell and Invoke-Build for this approach. All of share the same problem with lack of standard way of dealing with PowerShell extensions. One are scripts and other are modules. So the code is mix of fallowing lines:
Both are hacks rather the real solution. What I found usefull si the #Requires statement. To be more detailed -Module option. This allow to write scripts in this form: To make it work with packages.config and automatic nuget restoring, based on OneBuild, very simple bootstrap script that do the fallowing:
Of course and enrich manual the nuget packages that do not have the module definition with the psd1/psm1 files. As the result I found that I got fallowing results:
I think that there is the place for both packages, gallery and nuget.org, because they serves the same module to different audiences. The difference is only in the package file organization. It hard to tell that it will be unified one day, but this is yest another story :). I like the way Invoke-Build allow to organize process. I do not fully understand the script approach in nuget.org package, but agree that if peoples will see the psd1 they could first threat is as the module first. I hope you will find my explanation useful to think about it. Thanks |
@BartDubois, thank you for the detailed answer and useful explanation. I promise to think of this. It is so simple to add two files to the package, indeed. I just feel some "smell" and have doubts. |
@nightroman thanks. |
Hi @BartDubois, |
Done. Sorry that it took so long to get me convinced. |
No problem. Thank you. |
Hi,
I would like suggest to make include in nuget package also the module definition files.
Most of the nuget packages, with powershell, available at nuget.org have the psm1 and psd1 files in tools folder. As example look at 7Zip4PowerShell or psake.
The change is not invasive and allow to handle powershell packages in consistent way.
The text was updated successfully, but these errors were encountered: