0

我有一个充满 PowerShell cmdlet 的 C# DLL,我想知道如何从 PowerShell 提示符中检索 cmdlet 列表。我试过了:

Import-Module .\psconfig.dll
Get-Command -Name psconfig

但这不起作用。(导入有效,但不是Get-Command

执行此操作的正确方法是什么,以便我获得仅包含在我的 DLL 中的 cmdlet 的列表?

4

1 回答 1

3

Get-Command -Name psconfig正在寻找一个名为psconfig. 要获取从中导入的 cmdlet列表,psconfig.dll您需要列出该模块的导入 cmdlet:

Get-Command -ListImported -Module psconfig

要不就

Get-Command -Module psconfig
于 2016-01-05T17:23:00.893 回答