PoshCode / ModuleBuilder

A PowerShell Module to help scripters write, version, sign, package, and publish.
MIT License
445 stars 54 forks source link

dotnet template needs to ensure of unique GUIDs #81

Closed kilasuit closed 4 years ago

kilasuit commented 4 years ago

In the latest sets of changes to the dotnet template,on passing glance it looks like this will always create a module with a hardcoded GUID. So if you created 100 modules, they would all share the same GUID.

Whilst it's only a really minor thing, this is something that we should ensure is uniquely different on every run of the dotnet template at the creation of a module manifest, and ensure that this is then never changed as a module evolves.

Jaykul commented 4 years ago

Have you tried it?

This line should guarantee that the guids are unique. The ability to specify it via a config file instead of by making the template into invalid code is why I like dotnet templates ... https://github.com/PoshCode/ModuleBuilder/blob/b7dcb8acd4559380ad5aa7cdd0172bcf7c0f1dfd/Templates/Dotnet/ModuleBuilderModule/.template.config/template.json#L15

kilasuit commented 4 years ago

On testing it seems that it does create it with unique GUID's though from reading the template.json in vscode and hovering over the guids entry this is made pretty clear.

My bad for not reading the docs on dotnet templates