Table of contents
Ok, so, the idea is that you upload a .zip file containing your module and documentation. Let's take HttpRest (and something else?) as an example, and see what it would look like.
HttpRest is just a single .psm1 script a .psd1 metadata file, and a few .dll's that just go in the module folder. Installed in the user's Modules folder it looks like:
..\Modules\
..\Modules\HttpRest\
..\Modules\HttpRest\HttpRest.psd1
..\Modules\HttpRest\HttpRest.psm1
..\Modules\HttpRest\mindtouch.core.dll
..\Modules\HttpRest\mindtouch.dream.dll
..\Modules\HttpRest\SgmlReaderDll.dll
..\Modules\HttpRest\log4net.dll
So, we want you to zip up the "HttpRest" folder and upload it. Basically, we want you to be able to just right-click the HttpRest folder and choose Send To -> Compressed (zipped) Folder, and then login to PoshCode and upload the file.
We do need some information about the module though:
| Module MetaData | Information Sources (Red is unique for PoshCode) |
| Name | Contained Folder Name (Archive filename) |
| Version | PSD1 File (Archive filename) |
| Required Modules | PSD1 File |
| Description | PSD1 File |
| Author | PSD1 File (Authenticated User) |
| License | Comments in PSD1? |
| Optional Modules | Comments in PSD1? |
| Categorization | Comments in PSD1? |
| Documentation | Extra Documentation File |
Basically, other than what is naturally required by PowerShell modules, what we would require of you is that you specify the license and categorization. The rest is optional, but we highly recommend you include a README file in either HTML or Markdown format, and of course, if you have modules that could enhance your output -- you should specify them.
How can we get our extra metadata in?
PowerShell doesn't allow arbitrary values in the metadata (except in PrivateData).
- Add .License and .Categories as doc comments, and parse doc comments FOR THE MODULE out of the module manifest. This gives us a place to put the documentation too -- but people won't know to look there anyway. A README is better.
(not sure how to do this one)
- Embed the extra data in a special comment that we'll know to remove when parsing. Eg: <#!PoshCode ... #>
iex ((gc .\PoshWpf.psd1 -delim [char]0) -replace "<#!PoshCode([^$([Char]0)]*?)#>",'$1')
- Require a separate "MetaData.psd1" metadata file, so we can put whatever we like in it.
gmo -list | %{ ipmo ($_.FullName + "/MetaData")}
In this last case, I would then be able to do:
gmo MetaData ModuleType FullName ---------- -------- ManifestHuddledTricks ManifestPowerBoots
Those objects would have all the metadata. Of course, I still have the problem that only certain values are allowed in there, but since it's an extra file, I can dictate what you should put in the PrivateData, and other than that, you just copy YOUR file.
It's particularly elegant, because the "FullName" tells you what module it's for...

Comments