我有一个装满PowerShell cmdlet的C#DLL,我想知道如何从PowerShell提示符中检索cmdlet列表。我试过:
Import-Module .psconfig.dll
Get-Command -Name psconfig
但这行不通。(导入有效,但Get-Command
无效)
这样做的正确方法是什么,以便我只获得DLL中包含的cmdlet的列表?
Get-Command -Name psconfig
正在查找名为psconfig
的cmdlet。要获得从psconfig.dll
导入的cmdlet列表,您需要列出该模块的导入cmdlet:
Get-Command -ListImported -Module psconfig
或者只是
Get-Command -Module psconfig