如何在给定的模块中找到cmdlet(从文件加载)



我有一个装满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

相关内容

最新更新