一个很偏门的问题, C# 调用Powershell脚本,但是在Import-module的时候找不到servermanager module。
操作系统是windows server 2008 R2
但是如果直接执行脚本能找到该模块,而且在Module的目录下也能看到。
"the specified module server manager was not loaded because no valid module was found in any module directory"
这个问题我花费6个小时的时间,终于找到了问题的根源。
原因是ServerManager Module等几个module只有在64位系统上才有。
而我的C#程序编译成了32位,所以才找不到。
晕死了!!!
本文解决了一个特定问题:使用32位C#程序无法加载64位Windows Server 2008 R2上的ServerManagerModule。文章详细记录了作者耗时6小时定位并解决此问题的过程。

被折叠的 条评论
为什么被折叠?



