[英]How do I find the cmdlets in a given module (loaded from file)
I have a C# DLL full of PowerShell cmdlets, and I want to know how to retrieve the list of cmdlets from a PowerShell prompt. 我有一个充满PowerShell cmdlet的C#DLL,我想知道如何从PowerShell提示符下检索cmdlet列表。 I've tried: 我试过了:
Import-Module .\psconfig.dll
Get-Command -Name psconfig
But that doesn't work. 但这是行不通的。 (the import works, but not the Get-Command
) (导入有效,但Get-Command
无效)
What's the proper way to do this, so that I get a list of only the cmdlets included in my DLL? 什么是执行此操作的正确方法,以便仅获得DLL中包含的cmdlet的列表?
Get-Command -Name psconfig
is looking for a cmdlet named psconfig
. Get-Command -Name psconfig
正在寻找一个名为psconfig
的cmdlet。 To get a list of the cmdlets imported from psconfig.dll
you need to list the imported cmdlets for that module: 要获取从psconfig.dll
导入的cmdlet的列表,您需要列出该模块的导入的cmdlet:
Get-Command -ListImported -Module psconfig
or just 要不就
Get-Command -Module psconfig
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.