【问题标题】:How to troubleshoot the module nesting limit has been exceeded error in PowerShell V5?如何解决 PowerShell V5 中的模块嵌套限制已超出错误?
【发布时间】:2015-11-19 15:30:16
【问题描述】:
刚刚安装了管理框架 5 生产预览版,我的配置文件将不再加载并出现以下错误
Get-Module:无法加载模块“UserInfo.psm1”,因为已超出模块嵌套限制。模块只能嵌套
到 10 个级别。评估并更改加载模块的顺序以防止超出嵌套限制,然后再次尝试运行脚本。
有没有办法获得更多详细信息?
我尝试使用set-psdebug -trace 2 跟踪执行,但我看不到问题...
【问题讨论】:
标签:
powershell
powershell-5.0
powershell-module
【解决方案1】:
找到了,我从 .psd1 RequiredModules = @('coresmac','activedirectory') 和 .psm1 #requires -modules ActiveDirectory,userinfo 加载了相同的模块。
由于 requires 指令显示为注释,因此很容易错过它...