Requirements for Import-Module

Product: PowerShell Universal
Version: 1.4.6

When importing a module by using Import-Module Path one line above New-PSUEndPoint . Does the module need to be a psm1 with a definition file or can a simple ps1 with functions inside it also be imported?

It won’t actually import the module into your endpoints with this method.

You should look into environments: https://youtu.be/FJmpfzOVYiA

Thanks Adam, do the modules for the envrioment get loaded when when PSU loads or are they read during each API execution?

They are loaded when PSU creates a new runspace. PSU has a runspace pool so your module may be loaded multiple times depending on how busy your server is but each load will be into a new runspace. If it’s already been loaded into a runspace, it won’t be loaded again.

So what would you say is the best practice procedure to follow when we need a module reloaded because a change was done to it? Right now we’re restarting the PSU service but I’m sure that’s not the best thing to do.