Working with modules

Import, reload, and validate the built module during local development

NovaModuleTools is designed around working with the built PowerShell module in dist/, not just loose script files.

Import the built module

After building, import the output from dist/<ProjectName>:

nova build
$project = Get-NovaProjectInfo
Import-Module $project.OutputModuleDir -Force

This keeps your runtime behavior aligned with what you intend to publish.

Reload after changes

When you edit source files, rebuild and reload the module to avoid using stale code already loaded in the session:

$project = Get-NovaProjectInfo
Remove-Module $project.ProjectName -ErrorAction SilentlyContinue
nova build
Import-Module $project.OutputModuleDir -Force

Validate a local publish flow

If you want to test how the module behaves when copied to your local PowerShell module path:

nova publish -local

This is useful when you want to simulate a more realistic install-and-import cycle without publishing to a shared repository. After a successful local publish in PowerShell, NovaModuleTools reloads the published module from the local install path so you can use the freshly published version right away.

Use the packaged example as a working reference

The packaged example is available through nova init -Example. It is the fastest way to inspect a complete workflow that includes:

  • a real project.json
  • a public command
  • a private helper
  • a resource file
  • Pester tests against the built output

If you prefer learning from a working sample first, start there and then adapt the generated project to your own module.

If you have not scaffolded a project yet, go back to Getting Started. For the command sequence after that, use Core Workflows.