2

I have been testing a new PowerShell module locally, which has several functions and a couple of custom TypeDefinitions that are consumed by other modules.

One type I define is for the Verbosity:

Add-Type -TypeDefinition @"
public enum CommonLogVerbosityLevel
    {
        Normal,
        Detailed
    }
"@

I am able to use the type by using Import-Module, however I want this to autoload (like the functions) once the module is installed. If I don't it errors saying that it cannot find the type.

The test manifest exposes all the functions, but I have defined a stricter manifest for the released version as some functions and types are really only for internal use, so I don't want to expose those when I released the module.

Do I need to add the type to the manifest or find a different way to expose the type? Ideally I would like to know if the manifest can handle this.

G42
  • 9,791
  • 2
  • 19
  • 34
Luke Duddridge
  • 4,285
  • 35
  • 50
  • Not sure there is an answer to this, it appears it has to be imported in order to expose it. once in the module it was fine, so in the end I just referenced them as string / verb references. – Luke Duddridge Jul 06 '17 at 14:46

0 Answers0