Skip to content

Discuss project file (psd1) management with Plaster #219

@daviwil

Description

@daviwil

@kapilmb and I were talking about Script Analyzer improvements a few days ago, specifically around module-level analysis that can take all of the module's script files into account. One thing we will need for that is a way to easily find which .psd1 files actually get loaded as part of the module so that we can consider them in analysis. It seems that the best way to accomplish this is to encourage module authors to keep their .psd1's ScriptsToProcess field up to date with a complete list of files to be loaded.

Since nobody wants to maintain this by hand, it makes sense that some component in our editor tooling ecosystem take care of this for the user. Plaster seems like an obvious choice because we already enable single-file creation. It's not hard to imagine Plaster also updating the .psd1 when a new file is created as part of a project.

What do you think about adding some new commands to the module which enable file management for module projects? Maybe something like the following (definitely not married to the name):

Add-ModuleScript -Path ScriptToAdd.ps1 -ModulePath ..\path\to\MyModule.psd1

For existing projects which already have a bunch of files which aren't added explicitly to the .psd1, the VS Code integration could prompt the user to add them or provide some quick means of doing so (like an "Add to Project/Module" command or something.

This will also be very useful once we start adding templates for creating individual files to be added to a module. I think there is a great deal that Plaster can help the developer with after the initial project is created from a template.

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions