小编H. *_*ger的帖子

PowerShell:Import-Module,但没有"ExportedCommands"可用

我用的时候

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.有没有办法得到它失败的原因?

powershell cmdlet import-module

7
推荐指数
2
解决办法
5578
查看次数

标签 统计

cmdlet ×1

import-module ×1

powershell ×1