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?
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'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With