Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the module nesting limit in Powershell

Tags:

powershell

I received an error while attempting to import a Powershell module in another script, but I cannot seem to find any documentation on the error.

Error:

Cannot load the module 'AWSRestTools.psd1' because the module nesting limit has been exceeded. Modules can only be nested to 10 levels. Evaluate and change the order in which you are loading modules to prevent exceeding the nesting limit, and then try running your script again.

My module 'AWSRestTools' does not load any other modules, so it's unclear where the 'nesting' is occurring. The error mentions re-ordering the modules that are loaded, but I do not understand why. Would anyone mind shedding light on this error? Why is there a 'nesting limit', and what would reordering modules accomplish?

like image 869
Ci3 Avatar asked Apr 24 '15 16:04

Ci3


1 Answers

You need to reference the .psm1 (or .dll) file in the manifest... not the manifest file itself (.psd1). Basically, you're throwing it into a loop.

Correct:

# Script module or binary module file associated with this manifest.
RootModule = 'Module.psm1'
like image 194
daredev Avatar answered Nov 05 '22 11:11

daredev