我用的时候
Import-Module -Name <path_to_local_dll> -Verbose
Run Code Online (Sandbox Code Playgroud)
DLL文件中包含的cmdlet不会导出.
因此,当我键入Get-Module我导入的模块时,但没有任何ExportedCommands.为什么?
ModuleType Name ExportedCommands
---------- ---- ----------------
Binary MyModule
Run Code Online (Sandbox Code Playgroud)
在具有相同软件(PowerShell,.NET Framework,...)的第二台PC上,相同的导入DLL文件可以正常工作.在那里我得到了ExportedCommands.
这种行为取决于什么?
不幸的是,Import-Modulecmdlet没有表明它无法导入cmdlet.有没有办法得到它失败的原因?